Answers for "function in foreach"

131

javascript foreach

const avengers = ['thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
	console.log(index, item)
})
Posted by: Guest on April-27-2020
17

foreach javascript

var items = ["item1", "item2", "item3"]
var copie = [];

items.forEach(function(item){
  copie.push(item);
});
Posted by: Guest on February-27-2020
0

javascript foreach

arr.forEach(function callback(currentValue, index, array) {
    // tu iterador
}[, thisArg]);
Posted by: Guest on June-05-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language