Because the way it was indicated. The DOM API was developed separately from JavaScript. The fact that it NodeListhas some common aspects with JavaScript arrays ( lengthand indexing) is just ... well, it's probably not a coincidence, but a by-product of the inputs to the design process. Remember that JavaScript is not the only language that has DOM bindings.
You can easily affect the content NodeListusing the DOM API:
... or, of course, your favorite JavaScript library.
source
share