What is the difference between the following two ways to iterate over arrays using forEach
in Javascript?
array1.forEach(element => console.log(element));
array1.forEach(function(element) {console.log(element)});
What is the difference between the following two ways to iterate over arrays using forEach
in Javascript?
array1.forEach(element => console.log(element));
array1.forEach(function(element) {console.log(element)});