This course has been updated! We now recommend you take the JavaScript: The Recent Parts course.
Transcript from the "Exercise 2" Lesson
[00:00:00]
>> [MUSIC]
[00:00:03]
>> Kyle Simpson: 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. Will take like five minutes on exercise two, four minutes, it's a short exercise, okay?
[00:00:33] 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.
[00:00:53] In other words, I'm expecting an array back with the values 2, 8, 10 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 want to transport those values into foo, and in some way shape or form, I want to declare foo and return something from foo that ends up resulting in an array that has 2, 8, 10, and 12 in it.
[00:01:20]
>> Kyle Simpson: So using the same sort of stuff with gathers and spreads that we just talked about. See if you can declare that code.