I have a
Element.children is not an array. It is an object called an To loop through it, you'll have to convert it into an array, which you can do using Array.prototype.slice:
HTMLCollection
. These do not have an array’s methods (though they do have the length
property).var children = Array.prototype.slice.call(document.getElementById("niceParent").children);
children.forEach(…);