Check out a free preview of the full The Hard Parts of Asynchronous JavaScript course:
The "Iterators Exercise" Lesson is part of the full, The Hard Parts of Asynchronous JavaScript course featured in this preview video. Here's what you'd learn in this lesson:

Students work to code their own iterators as well as interacting with JavaScript's built-in iterators.

Get Unlimited Access Now

Transcript from the "Iterators Exercise" Lesson

>> Will Sentance: Okay people. These are gonna get so much more powerful in a moment but first, we're going to go back to our pairing, and you're gonna start pairing through some challenges on iterators. Get to your pairs. You're gonna go to CS bin. This time, csbin.IO/,, and start working through, building your very own iterators from scratch.

[00:00:33] And then using some of JavaScript's built in iterators, hint, you find the function that creates them under a wee property called symbol.iterator on every array. When you call that function, it's gonna give you out an equivalent of the returnNext element. That is our built-in iterator functions that are available for individual arrays.

[00:00:57] But your challenge is gonna start off with you building your own from scratch. All right, folks, here's for our online audience.
>> Will Sentance: The same, get back to your pairing, people, and.
>> Will Sentance: Let's just make sure the link, I'll just put the link up.

[00:01:12] Actually no, I think everyone got that., And we'll leave this code up.