Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function a() {
  2. ...
  3. }
  4. // 함수 선언(function declaration)으로 작성된 함수는 호이스팅(hoisting)이 되어 최상단으로 올라오게 됩니다.
  5.  
  6. var b;
  7. // 변수(variable) b가 호이스팅(hoisting)이 되어 최상단으로 올라오게 됩니다.
  8.  
  9. console.log(a);
  10. // 함수 a가 출력됩니다.
  11.  
  12. console.log(b);
  13. // 변수 b는 선언(declaration)은 되어있지만 아직 값은 할당(assignment)되지 않아서 undefined를 출력합니다.
  14.  
  15. b = function () {
  16. ...
  17. };
  18. // 변수 b에 함수를 할당(assignment)합니다.
  19.  
  20. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement