-
Notifications
You must be signed in to change notification settings - Fork 0
21. 빌트인 객체 #120
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
Merged
Merged
21. 빌트인 객체 #120
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# ✏️ 기억에 남는 내용 | ||
|
||
- 자바스크립트 객체의 분류 | ||
|
||
- 표준 필트인 객체 : ECMAScript 사양에 정의된 객체, 전역에 공통 기능 제공, 언제나 사용 가능, 전역 객체의 프로퍼티로서 제공됨, 언제나 참조 가능하다. | ||
|
||
- 호스트 객체 : 자바스크립트 실행 환경에서 추가로 제공하는 객체, 클라이언트 사이드 Web API를 호스트 객체로 제공한다. | ||
|
||
- 사용자 정의 객체 : 사용자가 직접 정의한 객체 | ||
|
||
- 표준 빌트인 객체 | ||
|
||
- 총 40여개의 표준 빌트인 객체 존재 | ||
|
||
- Math, Reflect, JSON을 제외하고 모두 인스턴스를 생성할 수 있는 생성자 함수 객체이다. | ||
|
||
- 생성자 함수 객체인 표준 빌트인 객체는 프로토타입 메서드와 정적 메서드 제공, 생성자 함수 객체가 아닌 표준 빌트인 객체는 정적 메서드만 제공한다. | ||
|
||
- 원시값과 래퍼 객체 | ||
|
||
- 원시값을 객체처럼 사용하면, 자바스크립트 엔진이 암묵적으로 연관된 객체를 생성하여 이를 가지고 작업 후 다시 원시값으로 되돌린다. | ||
|
||
- 문자열, 숫자, 불리언 값에 객체처럼 접근하면 생성되는 임시 객체를 래퍼 객체라 한다. | ||
|
||
- 래퍼 객체의 처리가 종료되면 가비지 컬렉션의 대상이 된다. | ||
|
||
- null, undefined는 래퍼 객체를 생성하지 않으므로 객체처럼 사용X | ||
|
||
- 전역 객체 | ||
|
||
- 코드가 실행되기 이전 단계에서 어떤 객체보다도 먼저 생성되는 특수한 객체 | ||
|
||
- 어떤 객체에도 속하지 않은 최상위 객체 | ||
|
||
- 브라우저 환경에서는 window(or self, this, frames), Node.js 환경에서는 global | ||
|
||
- 표준 빌트인 객체, 환경에 따른 호스트 객체, var 키워드로 선언한 전역 변수와 전역 함수를 프로퍼티로 가진다. | ||
|
||
- 특징 : 개발자가 의도적으로 생성 불가, window or global 생략 가능, 모든 표준 빌트인 객체를 프로퍼티로 가짐, 실행환경에 따라 추가적으로 프로퍼티와 메서드를 가짐, var 키워드로 선언한 전역 변수와 선언하지 않은 변수에 값을 할당한 암묵적 전역과 전역 함수는 전역 객체의 프로퍼티가 됨, let과 const 키워드로 선언한 전역 변수는 전역 객체의 프로퍼티가 아님, 모든 코드는 하나의 window 전역 객체를 공유한다. | ||
|
||
- 전역 객체의 프로퍼티와 메서드는 식별자 생략이 가능하므로, 전역 변수와 전역 함수처럼 사용 가능하다. | ||
|
||
- 빌트인 전역 프로퍼티 : 전역 객체의 프로퍼티, 전역에서 사용되는 값 제공 - Infinity(무한대 숫자값), NaN(숫자가 아님), undefined | ||
|
||
- 빌트인 전역 함수 | ||
|
||
- 암묵적 전역 : 선언하지 않은 변수를 전역 객체의 프로퍼티로 생성 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1. 전역에서 호출 가능한 빌트인 함수인 `eval`은 사용을 금지하는데, 그 이유를 간단히 서술하시오. | ||
Sun4-me marked this conversation as resolved.
Show resolved
Hide resolved
LSH-0125 marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.