DEV Community

Discussion on: Scope in Modern JavaScript

Collapse
 
naftalimurgor profile image
Naftali Murgor

Note: thevar keyword is deprecated as of ES6(ES2015). It's quite rare to see usage of var in mordern code bases due to the behavior that var introduces. Usage of var to declare and initialize variables still works because of back-ward compatibility of JavaScript. However, when working on pre-ES2015 code, trying to migrate to let and const will be too much effort for little to no benefit.