Skip to content

Instantly share code, notes, and snippets.

@hyonschu
Created June 8, 2013 20:48
Show Gist options
  • Save hyonschu/5736528 to your computer and use it in GitHub Desktop.
Save hyonschu/5736528 to your computer and use it in GitHub Desktop.
function each (obj, cmd) {
for (var i in obj) {
cmd(obj[i])
}
}
each([1,2,3], console.log)
function each (obj, cmd) {
for (var i in obj) {
cmd(obj[i])
}
}
each([1,2,3], alert)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment