I still have one use case for var - a browser's developer tools.
Often I need to quickly test an idea and I write var foo = 'bar'
then after some thoughts I press arrow up on keyboard and change previous input to var foo = 'baz'
With let I get Uncaught SyntaxError: Identifier 'foo' has already been declared and it always frustrating 😐
I still have one use case for
var- a browser's developer tools.Often I need to quickly test an idea and I write
var foo = 'bar'then after some thoughts I press
arrow upon keyboard and change previous input tovar foo = 'baz'With
letI getUncaught SyntaxError: Identifier 'foo' has already been declaredand it always frustrating 😐Oh yea, I use
varin console for the same reason!