Skip to content

Instantly share code, notes, and snippets.

@mcotton
Created March 20, 2011 23:20
Show Gist options
  • Save mcotton/878781 to your computer and use it in GitHub Desktop.
Save mcotton/878781 to your computer and use it in GitHub Desktop.
utils.each = function(arr, cb) {
for (var i = 0, len = arr.length; i < len; ++i) {
cb.length > 1 ?
cb(i, arr[i]) :
cb(arr[i])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment