-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should all the parameters with default values must be grouped together and put at the end of the parameters list? #57
Comments
tjwudi
changed the title
Something more about default parameters should be explained
Should all the parameters with default values must be grouped together and put at the end of the parameters list
May 5, 2014
tjwudi
changed the title
Should all the parameters with default values must be grouped together and put at the end of the parameters list
Should all the parameters with default values must be grouped together and put at the end of the parameters list?
May 5, 2014
Are suggesting something for the book or is this just a general question? |
This is allowed: function foo(a, b = "", c) {} This is not allowed: function foo(a, ...b, c) {} The original message body had an error pasted in—what was that produced by? |
just to clarify something... if you have: function foo(a, b = "", c) { console.log(a,b,c); } Then you cannot set foo(1, void 0, 3); // 1,undefined,3 not 1,"",3 Correct? |
@getify explicit foo(1, void 0, 3); // 1,"",3 |
TIL. thanks @rwaldron. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should all the parameters with default values must be grouped together and put at the end of the parameters list? What if I have a function definition like this
The text was updated successfully, but these errors were encountered: