11.
Destructuring
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
4 Comments
I've also seen this done at the function level:
> addRow({id, itemLabel, reps}) {
Hey GDIBass
That's interesting, I haven't seen it before. How does it work?
Yup!.
File testjs.js -----
function testit({id, name}) {
console.log(id,name);
}
testit({id: 'wow', name: 'wowee', somethingelse: 'alsowow'});
Command -----
$ node testjs.js
wow wowee
(credit goes to Tyler McGinnis... I saw him do this in his react course)
Nice, thanks for sharing it :)
Let's keep learning!
"Houston: no signs of life"
Start the conversation!