Skip to content

Instantly share code, notes, and snippets.

@stamat
Last active December 31, 2015 20:59
Show Gist options
  • Save stamat/8044025 to your computer and use it in GitHub Desktop.
Save stamat/8044025 to your computer and use it in GitHub Desktop.
A simple snippet for iterating arguments
var eachArg = function(args, fn, start_from, end_where) {
var i = start_from || 0;
while (i < args.length) {
if (end_where !== undefined && i === end_where)
return i;
if (fn !== undefined)
fn(i, args[i]);
i++;
}
return i;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment