DEV Community

Discussion on: A tricky JavaScript interview question asked by Google

Collapse
 
pinkyshelac profile image
Lisa Ziegler

Like the article, but I think it would help more people with a more thorough explanation. The answers don't exactly state where and why you get Index: 4. We forget people who are just learning and skip steps that are obvious to more advanced developers. Saying closure doesn't explain that the 'i' variable continues to increase. I personally never had one teacher explain the details of a for loop. You might never see it without making this mistake.