var num = 8; var num = 10; console.log(num);
8
10
SyntaxError
ReferenceError
With the var keyword, you can declare multiple variables with the same name. The variable will then hold the latest value.
var
You cannot do this with let or const since they're block-scoped and therefore can't be redeclared.
let
const