-
Notifications
You must be signed in to change notification settings - Fork 0
21. 빌트인 객체 #123
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
Open
L2HYUNN
wants to merge
3
commits into
main
Choose a base branch
from
21/L2HYUNN
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+52
−0
Open
21. 빌트인 객체 #123
Changes from all commits
Commits
Show all changes
3 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 @@ | ||
[URI & URL](https://www.charlezz.com/?p=44767) |
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,44 @@ | ||
# ✏️ 기억에 남는 내용 | ||
* 자바스크립트 객체의 분류 | ||
* **표준 빌트인 객체** | ||
* ECMAScript 사양에 정의된 객체, 애플리케이션 전역의 공통 기능을 제공한다. | ||
* 실행 환경(브라우저, Node.js)과 관계없이 언제나 사용할 수 있다. | ||
* 전역 객체의 프로퍼티로서 제공되며 별도의 선언 없이 전역 변수처럼 언제나 참조할 수 있다. | ||
* **호스트 객체** | ||
* 실행 환경(브라우저, Node.js)에서 추가로 제공하는 객체를 말한다. | ||
* 브라우저 환경에서는 클라이언트 사이드 Web API를, Node.js 환경에서는 고유 API를 제공한다. | ||
* **사용자 정의 객체** | ||
* 위와 같이 기본 제공되는 객체가 아닌 사용자가 직접 정의한 객체를 말한다. | ||
|
||
* 표준 빌트인 객체 | ||
* 자바스크립트는 40여 개의 표준 빌트인 객체를 제공한다. | ||
* Math, Reflect, JSON을 제외한 표준 빌트인 객체는 모두 **인스턴스를 생성할 수 있는 생성자 함수 객체다.** | ||
* 생성자 함수 객체인 표준 빌트인 객체는 **프로토타입 메서드와 정적 메서드를 제공한다.** | ||
* 생성자 함수 객체가 아닌 표준 빌트인 객체는 **정적 메서드만 제공한다.** | ||
|
||
* 원시값과 래퍼 객체 | ||
* 원시값이 존재하는데도 객체를 생성하는 표준 빌트인 생성자 함수가 존재하는 이유는 무엇일까? | ||
* 원시값에 대해 마치 객체처럼 마침표 표기법(또는 대괄호 표기법)으로 접근하면 자바스크립트 엔진이 일시적으로 원시값을 연관된 객체로 변환해 준다. | ||
* 이처럼 **문자열, 숫자, 불리언 값에 대해 객체처럼 접근하면 생성되는 임시 객체를 래퍼 객체(wrapper object)라 한다.** | ||
* 따라서 **String, Number, Boolean 생성자 함수를 new 연산자와 함께 호출하여 문자열, 숫자, 불리언 인스턴스를 생성할 필요가 없으며 권장하지도 않는다.** | ||
|
||
* 전역 객체 | ||
* 전역 객체(global object)는 **코드가 실행되기 이전 단계에 자바스크립트 엔진에 의해 어떤 객체보다도 먼저 생성되는 특수한 객체**이며, **어떤 객체에도 속하지 않은 최상위 객체다.** | ||
* 브라우저 환경에서는 window(self, this, frames), Node.js 환경에서는 global이 전역 객체를 가리킨다. | ||
* globalThis는 전역 객체를 가리키는 통일된 식별자이며 ECMAScript 표준 사양을 준수하는 모든 환경에서 사용할 수 있다. | ||
* 전역 객체의 특징 | ||
* 전역 객체는 개발자가 의도적으로 생성할 수 없다. 즉, 전역 객체를 생성할 수 있는 생성자 함수가 제공되지 않는다. | ||
* 전역 객체의 프로퍼티를 참조할 때 **window(또는 global)를 생략할 수 있다.** | ||
|
||
* 빌트인 전역 프로퍼티 | ||
* Infinity | ||
* NaN | ||
* undefined | ||
|
||
* 빌트인 전역 함수 | ||
* eval (사용 금지) | ||
* isFinite | ||
* isNaN | ||
* parseFloat | ||
* parseInt | ||
* encodeURI / decodeURI |
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,7 @@ | ||
# 📝 간단한 퀴즈 | ||
|
||
1. 자바스크립트 객체의 종류 3가지를 간단하게 서술하시오. | ||
|
||
2. `String`, `Number`, `Boolean` 생성자 함수를 `new` 연산자와 함께 호출할 필요가 없는 이유를 래퍼 객체(wrapper object)와 연관지어 설명하시오. | ||
|
||
3. `eval` 함수의 사용을 금지해야하는 이유를 서술하시오. | ||
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.