Day 30: Destructuring Assignment in JavaScript
#WomenWhoCode
#100DaysOfCode

https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧵" title="Thread" aria-label="Emoji: Thread">
Destructuring assignment is a special syntax introduced in ES6, for neatly assigning values taken directly from an object.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="1⃣" title="Tastenkappe Ziffer 1" aria-label="Emoji: Tastenkappe Ziffer 1"> to Extract Values from Objects:
https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">the name and age variables will be created and assigned the values of their respective values from the user object.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">You can see how much cleaner this is.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke"> You can extract as many or few values from the object as you want.
https://abs.twimg.com/emoji/v2/... draggable= to Extract Values from Objects:https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">the name and age variables will be created and assigned the values of their respective values from the user object. https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">You can see how much cleaner this is.https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke"> You can extract as many or few values from the object as you want." title="https://abs.twimg.com/emoji/v2/... draggable="false" alt="1⃣" title="Tastenkappe Ziffer 1" aria-label="Emoji: Tastenkappe Ziffer 1"> to Extract Values from Objects:https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">the name and age variables will be created and assigned the values of their respective values from the user object. https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">You can see how much cleaner this is.https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke"> You can extract as many or few values from the object as you want." class="img-responsive" style="max-width:100%;"/>
https://abs.twimg.com/emoji/v2/... draggable="false" alt="5⃣" title="Tastenkappe Ziffer 5" aria-label="Emoji: Tastenkappe Ziffer 5"> with the Rest Parameter to Reassign Array Elements:
https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">Sometimes, we might want to collect the rest of the elements into a separate array.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">Is similar to Array.prototype.slice()
https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">The rest element only works correctly as the last variable in the list.
https://abs.twimg.com/emoji/v2/... draggable= with the Rest Parameter to Reassign Array Elements:https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">Sometimes, we might want to collect the rest of the elements into a separate array. https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">Is similar to Array.prototype.slice()https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">The rest element only works correctly as the last variable in the list." title="https://abs.twimg.com/emoji/v2/... draggable="false" alt="5⃣" title="Tastenkappe Ziffer 5" aria-label="Emoji: Tastenkappe Ziffer 5"> with the Rest Parameter to Reassign Array Elements:https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">Sometimes, we might want to collect the rest of the elements into a separate array. https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">Is similar to Array.prototype.slice()https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ“Œ" title="Reißzwecke" aria-label="Emoji: Reißzwecke">The rest element only works correctly as the last variable in the list." class="img-responsive" style="max-width:100%;"/>
The end of this thread. https://abs.twimg.com/emoji/v2/... draggable="false" alt="šŸ˜" title="LƤchelndes Gesicht mit herzfƶrmigen Augen" aria-label="Emoji: LƤchelndes Gesicht mit herzfƶrmigen Augen">

Thank you for your time, I hope you found it useful. https://abs.twimg.com/emoji/v2/... draggable="false" alt="ā¤ļø" title="Rotes Herz" aria-label="Emoji: Rotes Herz">
You can follow @habibawael02.
Tip: mention @twtextapp on a Twitter thread with the keyword ā€œunrollā€ to get a link to it.

Latest Threads Unrolled: