I am trying to iterate through a NodeList using foreach. When I try to access with the following code, I get undefined in the console.
foreach = Array.prototype.forEach;
cls= document.getElementsByClassName('classname')
foreach.call(cls,function(some)
{
var ok = some.children;
foreac.call(ok,function(ss)
{
ss
});
});
I am trying this code in chrome developer tools. The console is returning 'undefined'. I am able to access by explicitly specifying the list position.