Guest User

Untitled

a guest
Jul 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. ```js
  2. var variableTest = "hi"
  3. variableTest = "hello"
  4. var variableTest = "Good Morning"
  5.  
  6. const constTest = "hi"
  7. // constTest = "hello"
  8. // const constTest = "Good Morning"
  9. // 구문 오류 : Identifier 'constTest' has already been declared
  10.  
  11. let letTest = "hi"
  12. letTest = "hello"
  13. // let letTest = "Good Morning"
  14. // 구문 오류 : Identifier 'letTest' has already been declared
  15.  
  16. console.log(variableTest, constTest, letTest)
  17. ```
  18. 테스트해보다 궁금한 점 생김
  19. - function scope(`var`)와 block scope(`let, const`) 뭐가 다르지?
  20. - `let` 재선언시 에러 나는 이유, `var`은 안 나는 이유
  21. - `let`에 재할당 가능한 이유, `const`는 재할당 불가능한 이유
  22.  
  23. => 변수, 상수인거 말고 이 값들 어떻게 관리하길래 이렇게 되는지
  24. +) primitive, 값 전달, 참조 전달 -> 변수 관련해서 설명할 수 있어야 하는 개념
  25. +) 형변환 (Type Casting)
Add Comment
Please, Sign In to add comment