-
Notifications
You must be signed in to change notification settings - Fork 4k
Trick get a new copy of object/array using spread operator #1823
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
Trick get a new copy of object/array using spread operator #1823
Conversation
CLA assistant check
All committers have signed the CLA.
3d6fa69 to
a2000fc
Compare
a2000fc to
9cc9ad2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not change this. It corresponds to the symbol on line 107.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 230 and 231 should be in one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally, github formatting does automatically a word wrap for one skipped line, the purpose was to keep easy to read code in the github editor
the javascript.info may not behave the same way, so i fixed it to one long line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 252 and 253 should be in one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as #1823 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 267 and 268 should be in one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as #1823 (comment)
0c158d9 to
a54f242
Compare
paroche
commented
Mar 29, 2020
Alexey -- is there a specific change you want me to look at? Everything I see above seems to be marked "outdated".
In the a54f242 branch linked to in the last section there is some awkward language:
'Note that it is possible to do the exact same to copy of objects: '
could be improved:
'Note that it is possible to do the exact same thing to copy objects:'
or
'Note that it is possible to do the exact same thing to make a copy of an object:'
(my preference)
Rest of the language is OK.
Anything else?
a54f242 to
f4cb058
Compare
fixed, it's indeed clearer
i removed the unneeded "exact" word :
'Note that it is possible to do the same thing to make a copy of an object:'
paroche
commented
Mar 29, 2020
Fine by me!
wonderingabout
commented
Mar 29, 2020
@paroche did you accidentally hit the close PR instead of the merge PR button (just asking myself 🤔 )
paroche
commented
Mar 29, 2020
You could say that. Anyway, as far as I'm concerned it should be merged (and closed).
And it is.
Not sure if it was my place, but if not, it can be undone.
wonderingabout
commented
Mar 29, 2020
yes, you can always @ me if we need to change something
A common trick using the spread operator :)
Credit goes to @Dorus for teaching me this trick !