-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Added Destructuring #11
base: master
Are you sure you want to change the base?
Conversation
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.
Nice start! Could you try to use pure destructuring on the couple examples I commented on? Thanks!
index.js
Outdated
@@ -1,7 +1,19 @@ | |||
const farmAnimals = 'cow horse sheep pig chicken'; | |||
|
|||
const [moo, neigh, baa, oink, cluck] = farmAnimals.split(" ") |
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.
farmAnimals
doesn't need to be split
.
const [moo, neigh, baa, oink, cluck] = farmAnimals.split(" ") | |
const [moo, neigh, baa, oink, cluck] = farmAnimals |
index.js
Outdated
|
||
const [r, o, y, g, b,, v] = colors | ||
|
||
const indg = colors[5] |
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.
See if you can make this work using destructuring.
Assigned variables to data within arrays and objects.