Answers for "for each arrow function"

23

foreach javascript arrow function

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

array1.forEach(element => console.log(element));
Posted by: Guest on January-10-2020
-1

foreach loop js arrow functons

someValues.forEach((element, index) => {
    console.log(`Current index: ${index}`);
    console.log(element);
});
Posted by: Guest on May-06-2020
0

for each loop with arrowfunction

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

OR

someValues.forEach((element, index) => {
    console.log(`Current index: ${index}`);
    console.log(element);
});
Posted by: Guest on August-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language