arr = [1,2,3]; arr.forEach(function(i){ // last iteration });
How to catch when the loop ending? I can do if(i == 3) but I might don\'t kn
if(i == 3)
const arr= [1, 2, 3] arr.forEach(function(element){ if(arr[arr.length-1] === element){ console.log("Last Element") } })