ES6- const & let are block level scoped variables

Block level means anything between curly braces. Variable defined within the curly braces will only be recognized there.

As for 'var', it is not block level scoped so it will be a global variable unless it is inside a function.

Comments

Popular posts from this blog

Code Wars: Data Reverse (6 kyu)

Code Wars: longest_palindrome (6 kyu)

Code Wars: Find the odd int