Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
"use strict";
var log = function log(x, index, array) {
console.log(index + ' : ' + x);
};
var ary = [10, 23, 10, 4, 0, 77];
ary.forEach(log);
/*
0 : 10
1 : 23
2 : 10
3 : 4
4 : 0
5 : 77
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment