Skip to content

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.

2 participants