Why am I able to declare a var multiple times? I would expect an error.
This code raises an error:
let a = true;
let a = false;
Uncaught SyntaxError: Identifier 'a' has already been declared
Why doesn't this raise an error too?
var b = true;
var b = false;
Expected: Uncaught SyntaxError: Identifier 'b' has already been declared