JeffLearnsReact – 9 – Iterators

Iterators iterate myArray = [‘one’, ‘two’, ‘three’]; .forEach() myArray.forEach(function(myArrayItem) { console.log(myArrayItem); }); myArray.forEach((myArrayItem) => { console.log(myArrayItem); }); .map() Iterates and CHANGES the contents of the array Powered by WPeMatico Related

Iterators iterate

myArray = [‘one’, ‘two’, ‘three’];

.forEach()

myArray.forEach(function(myArrayItem) {
console.log(myArrayItem);
});

myArray.forEach((myArrayItem) => {
console.log(myArrayItem);
});

.map()

Iterates and CHANGES the contents of the array

Powered by WPeMatico