DEV Community

Discussion on: Javascript var, let and const

Collapse
 
calvintwr profile image
calvintwr • Edited

And not forgetting the best that let has done is to solve nested looping:

for(let i=0; i<100; i++) { for(let i=0; i<500; I++) {}}

Where before you would need to be using i, j, k... until if you have complicated loops with conditionals, you won’t even know if it has conflicted.

Collapse
 
nagwan profile image
nagwan sami • Edited

this is one of the most common interview questions,
thanks for mentioning that,
i wanted to add this section, but i wanted the article to be as concise as I could,
thank u