> For example, natively getting a list of children is `el.children` but natively getting the parent is `el.parentNode`, not `el.parent`.
Actually, .children is the child elements; .childNodes is all the children (including comments and text as well as elements).
> Meanwhile, natively getting a list of classes is `el.classList`, but when I'm getting children I also get a list, so why not `el.childList` instead of `el.children`?
I’m not sure why they want with .classList instead of .classes, but I expect .className is a part of the history. If redesigning it from scratch and still retaining the functionality of .children, I’d rename it .childElements. Certainly not .childList.
And of course, the reasons for most of this stuff is the history. Some of the web’s APIs have aged well; others haven’t.
Actually, .children is the child elements; .childNodes is all the children (including comments and text as well as elements).
> Meanwhile, natively getting a list of classes is `el.classList`, but when I'm getting children I also get a list, so why not `el.childList` instead of `el.children`?
I’m not sure why they want with .classList instead of .classes, but I expect .className is a part of the history. If redesigning it from scratch and still retaining the functionality of .children, I’d rename it .childElements. Certainly not .childList.
And of course, the reasons for most of this stuff is the history. Some of the web’s APIs have aged well; others haven’t.