-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Docs: Default es6 features should clarify type of Spread operator #653
Comments
I've filed a pr for this, but I think the issue is invalid. The feature is not part of ES2015. |
The issue isn't about whether object spread operators are included in ES2015 or not. When I look at a list of supported features in my version of node, I don't care if it is in ES2015 or ES2017. I just want to know if I should be able to use it or not. Thanks for the PR, @lpinca. |
@lpinca There is an open issue to rename that page to "ES6 and beyond", so it's still okay. |
Ok. |
Closing as #661 is closed |
I don't understand why the related PR was getting rejected. I don't see why adding a little note to clarify that object spread operators are not supported, is so controversial that it must not be pointed out to readers seeking information about it. |
Reason already stated in the PR. |
@batjko the reason is that v5 will be end of life once v6 is released next week, which has better support for the spread operator. If we added the change we would have to revert it next week |
Actually the note was generic enough to not include the fact that spread operator did not work on destructuring assignments. Destructuring in not available in node 5 anyway. The reason is that spread operator documentation already makes it clear that it only works on array literals, function calls and destructuring so the note is redundant imho. |
Also as @fhemberger stated above, there is an ongoing work to create an "ES6 and beyond" page that should replace the current "ES6 in Node.js" page. |
Ah, Another thing I wasn't aware of, @thealphanerd . That of course makes total sense to me. I suppose my concern was simply that the generic phrasing simply assumes that everyone keeps closely up-to-date with all features and at which stage of their discussion / implementation they are at any given point. A lot of people just don't have the time to do that, so clarity is always preferable to "you should have read these other documents". But either way, it's going to be brought up-to-date with v6 anyway, so it's all good. |
Hi guys,
When I read through this list of features shipped by default:
https://nodejs.org/en/docs/es6/#which-features-ship-with-node-js-by-default-no-runtime-flag-required
... I thought it great that the Spread operator is now supported without any flags.
So I went and tried the spread operator on an object and was promptly met with an
Unexpected token ...
error, despite having node v5.10 installed.I then had to be educated by StackOverflow that it is only the Array spread operator that is supported, but not the Object spread operator.
I think this should be clarified on the page.
Many thanks.
The text was updated successfully, but these errors were encountered: