Original Link: http://davidwalsh.name/arguments-array?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Bludice+%28David+Walsh+Blog%29

Nice function from David Walsh on converting arguments to arrays in Javascript:

function myFn(/* any number of arguments */) {
	var args = Array.prototype.slice.call(arguments);
	// or [].slice.call(arguments)
	args.forEach(function(arg) {
		// do something with args here
	});
}

I can see a few uses for this function, hence why I’m sharing it…