how to iterate object with infinite children code example
Example: iterate over node object children
const secondaryNavList = document.querySelector('.navigation__secondary');
const secondaryNavListChildren = Array.from(secondaryNavList.children);
for (let secondaryNavListItem of secondaryNavListChildren) {
console.log(secondaryNavListItem);
}
const secondaryNavListChildren = Array.prototype.slice.call(secondaryNavList.children);
for (let secondaryNavListItem of secondaryNavListChildren) {
console.log(secondaryNavListItem);
}
const secondaryNavListChildren = secondaryNavList.childNodes;
secondaryNavListChildren.forEach((navListItem) => {
console.log(navListItem);
})