Have you guessed it?
The following code will write the value
What if I want values from
0-9 in the console?
There are different ways to achieve this.
By using IIFE
- IIFE is Immediately Invoked Function Expressions.
- By using IIFE’s we can also scope the value of the variable
ito print the current index, instead of printing the final value as
There is another way to fix this issue using ES6 syntax