“ES6 foreach Dom Element” Code-Antworten

Es6 foreach

const array1 = ['a', 'b', 'c'];

array1.forEach((element) => {
  console.log(element)
});

// expected output: "a"
// expected output: "b"
// expected output: "c"
Cute Chinchilla

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) {...});
Andrew Lautenbach

Ähnliche Antworten wie “ES6 foreach Dom Element”

Fragen ähnlich wie “ES6 foreach Dom Element”

Weitere verwandte Antworten zu “ES6 foreach Dom Element” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen