Summary
Both HTMLCollection and NodeList are valid ways to store aspects of a web page, but is one better than the other? Actually, what are the differences in the first place? HTMLCollection stores web page elements in an indexable list, either by number or some word/name. In addition, HTMLCollection stays updated with any new changes made to the page, which I think has both advantages and disadvantages. On one hand, you always have access to the newest code. On the other hand, a specific reference you set up in the past may no longer work if the new element took the place of the other. As for NodeList, it is also an indexable list, but it holds nodes instead of elements, which allows for more specific access. Also, once a NodeList is created, it cannot be changed, which basically has the opposite of the advantages and disadvantages that I included for HTMLCollection: the NodeList doesn't stay current, but you don't lose specific access. I think that not losing specific access might be more important for the NodeList because it can only be indexed through with numbers. Overall, like a lot of coding scenarios, the question of which is better cannot be easily answered since the use of one or the other depends on the situation.