Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading