[es6]var, let, const
같은 이름의 변수 선언
var foo = 'bar1';
var foo = 'bar2';let foo = 'bar1';
let foo = 'bar2';
// ERR : Uncaught SyntaxErr : Identifier 'foo has already been declared'호이스팅
console.log(foo); // undefiend
var foo;블록
let과 const는 적절한 관계
const
let
summary
Last updated
Was this helpful?