getElementsByClassName() and getElementsByTagName() are both return live HTMLCollection of elements, querySelector() returns found HTMLElement if any, if you meant querySelectorAll() it doesn’t return HTMLCollection but static (not live like 2 methods above) NodeList which in some browsers can be used with Array.prototype.forEach method. IMHO this article is full of misleading and incorrect data. I fully agree with Bob Myers .