Introduction
In this article, let us look at a very powerful yet simple feature introduced with ES6 or ES2015 version of JavaScript, the...
For further actions, you may consider blocking this person and/or reporting abuse
Object spreading, also helpful at react reducer function:
Thanks for sharing!
Hii Skay,
Thanks for writing such master peice postsπ, helped a lot in my case
πππππππ
I'm glad you found it useful. Please share it to reach maximum number of people.
Sureπ,
Also sorry in top comment I wanted to add Hii and autocorrect made it Byyπ°
No worries :-) I understood you were saying Hi.. have a great weekend and keep learning...
πππππ
Also wanted you to request to make another post on .map in Es6π,
That would be great.
Sure. I'll make one not just for map. But, higher order array functions such as map, filter, foreach, etc. Thanks for the suggestion.
Here you go.. dev.to/skaytech/es6-higher-order-f...
Thanks
I think you should also cover "The optional chaining operator (?.)" as spread operator is used to accessing deeper values in objects with safe defaults.
Could you provide an example of how it's related to the spread operator?. Or is it used along with spread operator? I'm not quiet sure how to relate that with the spread operator.
Example with optional chaining operator
let customer = {
name: "Carl",
details: {
age: 82,
location: "Paradise Falls" // detailed address is unknown
}
};
let customerCity = customer.details?.address?.city;
With spread operator
let { details: { address: {city: customerCity } ={}} = {} } = customer || {}
I also use it a lot to turn things like the output of document.querySelectorAll into an array.
Totally! I find that as probably the most common use cases amongst all. Glad you took the time to read through the article. Thank you!
Nice article... Detailed explanation, and exercises are really helpful.
Good article thanks for sharing.
I'm glad you enjoyed the article! Thanks for reading!!