For item of array

Recall that if all we wish to do is read a list (array) and not change anything then we need not go to all the bother of a creating an index iterator.

const places = []    // consider this filled with destinations
for (let place of places) {
    console.log(`I would like to visit, ${place}.`)
}
1 Like

I don’t think for...of is even mentioned in the lesson on loops. I figured I had caused enough confusion already by bringing up objects prematurely. As I recall, I don’t believe for...of is discussed at all in any of the CC lessons (I could be wrong). I believe I first learned of it from one of your previous posts. :grinning:

1 Like

Ah! Then I should quit bringing it up, or perhaps you could ping the curriculum team on jira? My recollection of course order has gone to the wind, at this point. 'Fraid that leaves me open to jumping the queue, etc.

1 Like

I may suggest it to the curriculum team, but as for your bringing it up, as I said, that’s how I first learned of it, so I appreciate that you do bring it up. :+1:

1 Like