Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1주차][홀랄리] var vs let vs const #107

Open
wants to merge 1 commit into
base: eotkd4791
Choose a base branch
from

Conversation

eotkd4791
Copy link
Collaborator

#67


- 블록이란 함수, 반복문, 조건문, 빈 블록 등 중괄호({})로 감싸진 영역을 의미합니다.

- 또한 var는 전역 스코프에서 선언하면 window 객체의 프로퍼티가 되지만, const/let은 전역에서 선언하더라도 window 객체의 프로퍼티가 되지 않습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strict mode 일때는 var로 전역 스코프에서 선언해도 window 객체의 프로퍼티가 안되지 않나요..?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인해보았는데 strict mode에서도 window 객체 프로퍼티가 되는 것 같습니다!

'use strict';
var isGlobal = true;
console.log(window.hasOwnProperty('isGlobal')); // true
console.dir(window); // 아래 이미지 첨부

스크린샷 2021-10-26 오후 11 22 05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants