-The three collections of Htmlcollection, NodeList and NamedNodeMap are "dynamic" and are the objects of life and breathing.
-they are actually the result of executing queries based on the DOM structure, so changes in the DOM structure can automatically reflect these objects.
-Each time the document structure changes, they will be updated. As a result, they always keep the latest and most accurate information.
Let me take a look at the following code:
var divs = document.getElementsByTagName ("div"); var i = 0; while (I < divs.length) { document.body.appendChild (document.createelement ("div")); I+ +; }
This is going to be a dead loop!
Because DIVs is a collection of htmlcollection obtained through getElementsByTagName (), it is "dynamic". Each time the Document.body.appendChild (DIV) is executed, the divs.length increases.
(iv) The dynamic nature of an array-like object