I was recently learning about the querySelectorAll() method in JavaScript and the fact that it returns back a NodeList object containing all the elements that match a particular CSS selector.
Now the confusion I have is that if querySelectorAll() is meant to only match element nodes, why doesn't it return back an HTMLCollection instead, like getElementsByClassName() and getElementsByTagName() do?
What's the point of querySelectorAll() returning back a NodeList instance?
Is it the case that querySelectorAll() can be used to select non-element nodes as well?