DEV Community

Discussion on: Let's re-implement JavaScript's Array.map method!

Collapse
 
rpearce profile image
Robert Pearce • Edited

Nice article, and I'm actually about to make a video on this exact same subject!

I noticed that when you do the for loop, there's i = 0, instead of let i = 0, and this could result in the creation (or mutation) of a global variable. Funny enough, i is a global variable on dev.to at the moment, and it's value is 0! But once you run the code above, it gets updated.

Good job on this article!

Collapse
 
jchiatt profile image
J.C. Hiatt

Nice catch!