Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Lsimmons98
Copy link

Assigned variables to data within arrays and objects.

Copy link

@stephenmckeon stephenmckeon left a 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(" ")

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.

Suggested change
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]

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.

stephenmckeon

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants