Last active
August 29, 2015 14:19
-
-
Save domderen/3c901b4652624c159b2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right, @naholyr’s code is the actual solution, I showed how to use a rest parameter instead of
arguments
.