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: String incrementer

Code Wars: Replace With Alphabet Position

Code Wars: Find the odd int