Quick Tip: Use let with for Loops in JavaScript

The other problem using let and const will fix is with our for loop. First of all, if I type i into the console, it returns 10. We have this global variable that has leaked into the window, or into a parent scope, which is not something we necessarily want….

Source: http://wesbos.com/for-of-es6/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.