Skip to content

Instantly share code, notes, and snippets.

@dlueth
Last active January 2, 2018 15:25
Show Gist options
  • Save dlueth/5773923 to your computer and use it in GitHub Desktop.
Save dlueth/5773923 to your computer and use it in GitHub Desktop.
JavaScript: Convert a functions array-like arguments to array
/*
* Works on e.g.: arguments (cross-browser)
* Does not work on e.g.: NodeList like from "document.getElementsByTagName"
*/
function foo() {
var args = [].slice.call(arguments, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment