Skip to content

Instantly share code, notes, and snippets.

@domderen
Last active August 29, 2015 14:19
Show Gist options
  • Save domderen/3c901b4652624c159b2d to your computer and use it in GitHub Desktop.
Save domderen/3c901b4652624c159b2d to your computer and use it in GitHub Desktop.
const fun = ({param1 = 'some default value', param2 = 'other default value'} = {}) => {
console.log(param1);
console.log(param2);
console.log(options); // Can I somehow get access to the object that has param1 and param2 inside?
console.log(arguments[0]); // Is this the only way?
};
@rauschma
Copy link

Right, @naholyr’s code is the actual solution, I showed how to use a rest parameter instead of arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment