TIL#9 Javascript var, let, const
var name = "Hello";
console.log(name); // Hellovar name = "world";
console.log(name); // world
const name = "Hello";
console.log(name); // Helloconst name = "world";
console.log(name); // Uncaught SyntaxError: Identifier 'b' has already been declared
let name = "Hello";
console.log(name); // Hellolet name = "world";
console.log(name); // error!
var name = "Hello";
console.log(name); // Hello
name = "world";
console.log(name); // world
const name = "Hello";
console.log(name); // Helloname = "world";
console.log(name); // Uncaught TypeError: Assignment to constant variable.
let name = "Hello";
console.log(name); // Helloname = "world";
console.log(name); // world