In this exercise, you must modify the code in the ex2.js file and use the gather and spread operators to manipulate the two arrays in the bar function. This way, the foo function returns a value that makes the console.log statement at the bottom true.
(dojo music)…- I think that's good on our gather and spread…so let's open up exercise two.…And this is, we will finish exercise two…and then take our lunch break, okay?…So go ahead and open it up…and I'll orient you to exercise two…and then give you,…we'll take like five minutes on exercise two,…four minutes, it's a short exercise, okay?…Same kind of thing that I was just talking about before,…the kinds of tricks that we can play…with spreads and gathers and with parameters.…
The spirit of this exercise is that…when I call the bar function,…which is giving me back whatever comes back from foo,…that's gonna give me an array that if I join those together…comes to this string.…In other words, I'm expecting an array back…with the values 2810 and 12 in it…and the starting values that I have to play…with are these two arrays.…So in some way, shape, or form,…I wanna transport those values into foo…and in some way, shape, or form,…I wanna declare foo and return something from foo…that ends up resulting in an array…that has 2810 and 12 in it.…
This course was created by Frontend Masters. It was originally released on 01/10/2017. We're pleased to host this training in our library.
- The arrow function
- Arrow function variations
- Closures and explicit blocks
- Default values
- Using the gather and spread operators
- Dumping variables
- Concise properties and methods
- Symbols, iterators, and generators
- Optimizing codes for the reader
Skill Level Intermediate
1. Arrow Functions
2. Block Scope
3. Default Values and the Gather/Spread Operators
5. Template Strings
6. Symbols, Iterators, and Generators
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.