The return value of querySelectorAll() is not an array of Element objects. Instead, it is an iterablearray-like object known as a NodeList.
NodeList objects
have a length property, can be indexed like arrays.
can loop with traditional for( ; ; ) loop, for-of loop, forEach() method.
can convert into array with Array.from().
However, some older browsers have not implementedNodeList.forEach() nor Array.from(). This can be circumvented by using Array.prototype.forEach() โ see this document's Example.