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 up
on keyboard and change previous input tovar foo = 'baz'
With
let
I getUncaught SyntaxError: Identifier 'foo' has already been declared
and it always frustrating 😐Oh yea, I use
var
in console for the same reason!