There are many DOM APIs that return a live NodeList or HTMLCollection such as childNodes and getElementsByTagName. However, the fact they reflect the live view of the DOM tree introduces a significant code complexity and runtime cost. Consider the following code: var headers = document.getElementsByTagName('h1'); for (var i = 1; i <= headers.length; i++) { var prefix = document.createTextNode(i +