Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 4
    In the second one the variable also be global and accesible outside of for loop. In javascript there are no block scope only function scope. Commented Dec 17, 2015 at 10:18
  • @jcubic there is block level scope in ES6. Commented Dec 17, 2015 at 10:21
  • 2
    OP ask about var not let. Commented Dec 17, 2015 at 10:29
  • 1
    Even if you were right, you've got your examples mixed up. Commented Dec 17, 2015 at 10:35