Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Javascript

For Loop Closure 2

Instructions

In the previous activity, we reviewed some code that did not behave the way we wanted it to. We wanted code that when executed, printed out the value of i at the point in the for loop when the setTimeout was created. In this activity, we're going to be writing that code, but with a lot of restrictions in order to get more practice with closure and immediately invoked functions again.

  • Each call of setTimeout must console log the value of i when it is created.

  • Do not change any code outside of the designated area, which means you're defining the first argument passed to setTimeout.

    • Keep this in mind and remember the tools you used to solve the other activity regarding closure and immediately invoked functions
  • If you need more guidance, refer to the hint.md file within the hint folder.