DEV Community

Discussion on: 3 reasons to use 'var' in JavaScript

Collapse
 
andyhilton profile image
Andy Hilton

Why didn't let just replace var? If the whole world is against it why does it still exist?

Collapse
 
paritho profile image
Paul Thompson

The EcmaScript committee has strict guidelines to 'not break the web'. Meaning, old JS code must always work.

Collapse
 
koire profile image
Koire

Also let is scoped

Collapse
 
emptyother profile image
emptyother

Nobody want to dig up and rewrite their 10 year old production code. But eventually it too will go the way of elem.attachEvent() and the <blink> tag.