“ES6 Foreach” Kod odpowiedzi

ES6 Foreach

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

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

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

Foreach Jas

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

array1.forEach(element => console.log(element));
Tame Turkey

Boucle Foreach JS

let listeDePays = ['France', 'Belgique', 'Japon', 'Maroc'];
listeDePays.forEach(pays => console.log(pays));
Crevure 01

ES6 FOREACH DOM

//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

Odpowiedzi podobne do “ES6 Foreach”

Pytania podobne do “ES6 Foreach”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu