Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

es6 foreach dom element

//es6
Array.from(els).forEach((el) => {
});

//old shit
Array.prototype.forEach.call(els, function(el) {
    // Do stuff here
    console.log(el.tagName);
});

// Or
[].forEach.call(els, function (el) {...});
 
PREVIOUS NEXT
Tagged: #foreach #dom #element
ADD COMMENT
Topic
Name
9+1 =