Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created March 9, 2021 20:01
Show Gist options
  • Save NyaGarcia/10c7f1a947896aa7751f9d1735d86dd3 to your computer and use it in GitHub Desktop.
Save NyaGarcia/10c7f1a947896aa7751f9d1735d86dd3 to your computer and use it in GitHub Desktop.
arguments object in an arrow function
const getArguments = () => Array.from(arguments);
console.log(getArguments(1, 2, 3, 4));
// Output: [ƒ (), Object, Object, "/~/index.js", "/~", Window, Window, Object, ƒ c()]
console.log(getArguments("arguments", "is", "cool"));
// Output: [ƒ (), Object, Object, "/~/index.js", "/~", Window, Window, Object, ƒ c()]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment