Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```js
- var variableTest = "hi"
- variableTest = "hello"
- var variableTest = "Good Morning"
- const constTest = "hi"
- // constTest = "hello"
- // const constTest = "Good Morning"
- // 구문 오류 : Identifier 'constTest' has already been declared
- let letTest = "hi"
- letTest = "hello"
- // let letTest = "Good Morning"
- // 구문 오류 : Identifier 'letTest' has already been declared
- console.log(variableTest, constTest, letTest)
- ```
- 테스트해보다 궁금한 점 생김
- - function scope(`var`)와 block scope(`let, const`) 뭐가 다르지?
- - `let` 재선언시 에러 나는 이유, `var`은 안 나는 이유
- - `let`에 재할당 가능한 이유, `const`는 재할당 불가능한 이유
- => 변수, 상수인거 말고 이 값들 어떻게 관리하길래 이렇게 되는지
- +) primitive, 값 전달, 참조 전달 -> 변수 관련해서 설명할 수 있어야 하는 개념
- +) 형변환 (Type Casting)
Add Comment
Please, Sign In to add comment