// Check if, last index of array in foreach Loop. arr = [1, 2, 3]; arr.forEach(function(val, index, array){ if (index === array.length - 1){ console.log("Last callback call at index " + index + " with value " + val ); } });