Тёмный

What is the Difference Between children and childNodes? 

Steve Griffith - Prof3ssorSt3v3
Подписаться 103 тыс.
Просмотров 6 тыс.
50% 1

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@kllokoq
@kllokoq 4 года назад
Fantastic! Finally I understood why carriage returns are text-nodes, because they are represented by the string " " I guess. It's true this is quite confusing for a beginner like me, because we are bombarded with everything at the same time: memorizing syntax, remembering methods and property names etc. It's just becomes overwhelming and frustrating sometimes. But then there are moments like these of momentary enlightenement! I love your work!
@paulgz101
@paulgz101 4 года назад
Thanks for great JS tutorials. Most in-depth ones on youtube.
@EDC.EveryDayCode
@EDC.EveryDayCode 4 года назад
Hi I found it really cool that the whitespace is a text child.
@flybon1097
@flybon1097 2 года назад
Excellent as always Keep up the good work
@chrisplusplus6232
@chrisplusplus6232 4 года назад
👍👍👍
@gfddgitgud3848
@gfddgitgud3848 2 года назад
awesome!! thanks
@ernestinacarneiro
@ernestinacarneiro 2 года назад
Muito obrigada.😃
@nikhilupadhyay8082
@nikhilupadhyay8082 3 года назад
I have a doubt. Kindly point out the error in the following code. let val; const list = document.querySelector('ul.collection'); val = list.children; val.forEach((values) => { console.log(values); });
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 года назад
querySelector( ) returns one element, not an array.
@evanoshea9506
@evanoshea9506 2 года назад
thank you!
@waheed1987
@waheed1987 4 года назад
Hi, What theme do you use? I really like the dots and colored tabs used for indentation.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 года назад
It's the indent rainbow extension
@waheed1987
@waheed1987 4 года назад
@@SteveGriffith-Prof3ssorSt3v3 Thank you, just installed it. It's a very popular one too... Now, just a couple of formatting extensions for php and I will be good to ditch the phpstorm from next year :D
@waheed1987
@waheed1987 4 года назад
not showing dots all the time for me. Only shows dots when I select the code...
@tahasoft1
@tahasoft1 4 года назад
Thanks Steve. I think it is possible to use Array.from or spread on children like this [...children].forEach(console.log)
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 года назад
The biggest thing with `children` is that it is a live HTMLCollection. That means it changes as the DOM is altered and so will its length and the Array that you generate from it. Otherwise, yes Array.from( ) is a good way to extract a snapshot of the children.
@thatsisjustcrazy8187
@thatsisjustcrazy8187 4 года назад
@@SteveGriffith-Prof3ssorSt3v3 I've been using "for of" loops to iterate through HTML collections like this. Are there any notable advantages to the these different techniques? [].forEach.call(children) from your video, spread like this comment, or "for of"??
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 года назад
When working with HTML Collections I almost always use the Array methods map(), forEach(), filter( ), and so on. Mainly because they are easy to read and can be chained together - functional programming.
@suvendudas5391
@suvendudas5391 4 года назад
Sir, i love your content. But this topic can be explained in a more simplified way.but i find your explanation little complex(respect to the topic). Don't mind. It's just an opinion of me.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 года назад
I could explain it with one or two sentences. I prefer to provide more in depth detail.
Далее
HTML5 Details and Summary Elements
7:16
Просмотров 4,5 тыс.
What Exactly Are Nodes In The JavaScript DOM?
10:37
Просмотров 6 тыс.
Console is More Than Just log
11:16
Просмотров 4,8 тыс.
Checking for the Existence of JavaScript Variables
9:08
Do You Know The Difference?
8:47
Просмотров 57 тыс.
Tagged Template Literals
11:11
Просмотров 11 тыс.
HTML DOM Tree - You Must Know This
8:25
Просмотров 7 тыс.
What are NodeLists in JavaScript? 📃
13:22
Просмотров 10 тыс.
JS Code Structure Moving Beyond Beginner
21:31
Просмотров 13 тыс.