Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function a() {
- ...
- }
- // 함수 선언(function declaration)으로 작성된 함수는 호이스팅(hoisting)이 되어 최상단으로 올라오게 됩니다.
- var b;
- // 변수(variable) b가 호이스팅(hoisting)이 되어 최상단으로 올라오게 됩니다.
- console.log(a);
- // 함수 a가 출력됩니다.
- console.log(b);
- // 변수 b는 선언(declaration)은 되어있지만 아직 값은 할당(assignment)되지 않아서 undefined를 출력합니다.
- b = function () {
- ...
- };
- // 변수 b에 함수를 할당(assignment)합니다.
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement