Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet - Underscore Each
var fibarray = new Array( 0, 1, 1, 2, 3, 5, 8, 13);
_.each([fibarray, function(val) {
console.log(val);
});
var oneTwoThree = {one: 1, two: 2, three: 3};
_.each(oneTwoThree, function(val, key){
console.log(val + ": " + key);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment