What does an array with the value #text in the index 0 mean?

Issue

What does an array with the value #text in the index 0 mean And where did it come from?
I explained my meaning below.

this is HTML code:

<div class="todo-container">
    <div class="todoList">
  
    </div>
  </div>

and this is JS code:

const todoList = document.querySelector(".todoList");
 
//function

function filtersTodo(e) {
const todos = [... todoList.childNodes];
console.log(todos);
}

And this is what it shows me as output:img of output console.log(todos)

another picture

My question is where Array [#text] came from and why?

Solution

"Everything in the DOM is represented by a node. Including plain text."

See this post: https://stackoverflow.com/a/21357034/16633894

Answered By – TheBeigeOrca

Answer Checked By – Dawn Plyler (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.