-
Notifications
You must be signed in to change notification settings - Fork 0
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
28, 29장 #23
28, 29장 #23
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,263 @@ | ||
# Number | ||
|
||
표준 빌트인 객체인 Number는 원시 타입인 숫자를 다룰 때 유용한 프로퍼티와 메서드를 제공한다. | ||
|
||
## 28.1 Number 생성자 함수 | ||
|
||
Number 객체는 생성자 함수 객체다. 따라서 new 연산자와 함께 호출하여 인스턴스를 생성할 수 있다. | ||
|
||
생성자 함수에 인수를 전달하지 않고 new 연산자와 함께 호출하면, [[PrimitiveValue]] 내부 슬롯에 0을 할당한 Number 래퍼 객체를 생성한다. | ||
|
||
 | ||
|
||
생성자 함수에 인수로 숫자를 전달하면서 new 연산자와 함께 호출하면, [[PrimitiveValue]] 내부 슬롯에 전달받은 숫자를 할당한 Number 래퍼 객체를 생성한다. | ||
|
||
 | ||
|
||
Number 생성자 함수의 인수로 숫자가 아닌 값을 전달하면 인수를 숫자로 강제 변환 후 객체를 생성한다. 인수를 숫자로 변환할 수 없다면 Nan을 할당한 객체를 생성한다. | ||
|
||
new 연산자를 사용하지 않고 생성자 함수를 호출하면 Number 인스턴스가 아닌 숫자를 반환한다. | ||
|
||
```jsx | ||
const a = new Number(123); | ||
a === 123 // false | ||
|
||
const b = Number(123); | ||
b === 123 // true | ||
``` | ||
|
||
## 28.2 Number 프로퍼티 | ||
|
||
### 28.2.1 `Number.EPSILON` | ||
|
||
두 개의 표현 가능한 숫자 사이의 최소 간격. | ||
|
||
1과 1보다 큰 숫자 중에서 가장 작은 숫자와의 차이($2.2204460492503130808472633361816\times10^{-16}$)이다. | ||
|
||
```jsx | ||
0.1 + 0.2; // 0.30000000000000004 | ||
0.1 + 0.2 === 0.3; // false | ||
``` | ||
|
||
부동소수점 산술 연산은 정확한 결과를 기대하기 어려운데, 이러한 오차를 해결하기 위해 사용할 수 있다. | ||
|
||
```jsx | ||
function isEqual(a, b) { | ||
return Math.abs(a-b) < Number.EPSILON; | ||
} | ||
isEqual(0.1+0.2, 0.3); // true | ||
Comment on lines
+45
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 컴구가 새록새록 떠올랐는데.. |
||
``` | ||
|
||
두 수의 차이가 Number.EPSILON보다 작으면 같은 수로 인정하는 방식이다. | ||
|
||
### 28.2.2 `Number.MAX_VALUE` | ||
|
||
자바스크립트에서 표현할 수 있는 가장 큰 양수 값($1.7976931348623157 \times 10^{308}$)이다. 이것보다 큰 숫자는 `Infinity` 다. | ||
|
||
```jsx | ||
Infinity > Number.MAX_VALUE // true | ||
``` | ||
|
||
### 28.2.3 `Number.MIN_VALUE` | ||
|
||
자바스크립트에서 표현 할 수 있는 가장 작은 양수값($5 \times 10^{-324}$)이다. 이것보다 작은 숫자는 0이다. | ||
Comment on lines
+61
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분을 보고 그러나 이는 오답입니다. 실제로 실제로 두 수의 차이는 너무 작아서 사실상 거의 같은 숫자라고 판단해도 되지만, 예제를 살펴봅시다! function main() {
function isEqualByMIN_VALUE(a, b) {
return Math.abs(a - b) < Number.MIN_VALUE;
}
function isEqualByEPSILON(a, b) {
return Math.abs(a - b) < Number.EPSILON;
}
const a = 0.1 + 0.2; // 실제 값: 0.30000000000000004
const b = 0.3;
console.log(a); // 0.30000000000000004
console.log(b); // 0.3
console.log(isEqualByMIN_VALUE(a, b)); // false
console.log(isEqualByEPSILON(a, b)); // true
} 따라서 두 수를 비교할 때는 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 근데 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. '작다'라는 판단을 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1 + Number.MIN_VALUE는 1이고, 1 + Number.EPSILON은 1.0000000000000002이네용 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
### 28.2.4 `Number.MAX_SAFE_INTEGER` | ||
|
||
자바스크립트에서 안전하게 표현할 수 있는 가장 큰 정수값(9007199254740991)이다. (= 53비트로 표현할 수 있는 가장 큰 정수 2^53 - 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 만약 서비스 특성상 더 큰 정수값을 다뤄야 하는 경우, 이를 문자열로 변환하여 비교하는것이 효과적일까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 문자열을 비교할 때는 사전순으로 비교하기( BigInt는 숫자 리터럴 뒤에 n을 붙이거나 다음 몇가지 주의사항만 조심하면 됩니당
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bignumber.js라는 외부 라이브러리도 존재하긴 하네요.. import BigNumber from "bignumber.js";
const bigNum1 = new BigNumber("9007199254740991000000");
const bigNum2 = new BigNumber("10");
console.log(bigNum1.plus(bigNum2).toString()); // "9007199254740991000010"
console.log(bigNum1.times(bigNum2).toString()); // "90071992547409910000000" |
||
|
||
>[!note] | ||
>자바스크립트에서 숫자는 **64비트 부동소수점 형식**(IEEE 754 표준)을 사용하여 저장되고, 정수 부분에 대해 53비트만 사용한다. | ||
|
||
### 28.2.5 `Number.MIN_SAFE_INTEGER` | ||
|
||
자바스크립트에서 안전하게 표현할 수 있는 가장 작은 정수값(-9007199254740991)이다. (= 53비트로 표현할 수 있는 가장 작은 정수 -(2^53 - 1)) | ||
|
||
### 28.2.6 `Number.POSITIVE_INFINITY` | ||
|
||
양의 무한대를 나타내는 숫자값 Infinity와 같다. | ||
|
||
### 28.2.7 `Number.NEGATIVE_INFINITY` | ||
|
||
음의 무한대를 나타내는 숫자값 -Infinity와 같다. | ||
|
||
### 28.2.8 `Number.NaN` | ||
|
||
숫자가 아님(Not-a-Number)을 나타내는 숫자값이다. `window.NaN`과 같다. | ||
|
||
|
||
## 28.3 Number 메서드 | ||
|
||
### 28.3.1 `Number.isFinite` | ||
|
||
인수로 전달된 숫자값이 정상적인 유한수인지 검사하여 그 결과를 불리언값으로 반환한다. | ||
|
||
**빌트인 전역 함수 `isFinite`와 비교** | ||
|
||
- `isFinite`는 전달받은 인수를 숫자로 암묵적 타입 변환하여 검사를 수행한다. | ||
- `Number.isFinite`는 전달받은 인수를 숫자로 암묵적 타입 변환하지 않는다. 따라서 숫자가 아닌 인수가 주어졌을 때 반환값은 언제나 false이다. | ||
|
||
```jsx | ||
Number.isFinite(null); // false | ||
isFinite(null); // true | ||
``` | ||
|
||
null은 암묵적으로 숫자 0으로 변환되기 때문에 true가 반환되었다. | ||
|
||
```jsx | ||
Number.isFinite(NaN); // false | ||
isFinite(NaN); // false | ||
``` | ||
|
||
NaN은 숫자로 암묵적 타입 변환이 불가능하기 때문에 false가 반환되었다. | ||
|
||
### 28.3.2 `Number.isInteger` | ||
|
||
인수로 전달된 숫자값이 정수인지 검사하여 그 결과를 불리언 값으로 반환한다. 검사하기 전에 암묵적 타입 변환하지 않는다. | ||
|
||
```jsx | ||
Number.isInteger(0) // true | ||
Number.isInteger(123) // true | ||
|
||
Number.isInteger(0.5) // false | ||
Number.isInteger('123') // false | ||
Number.isInteger(true) // false | ||
Number.isInteger(null) // false | ||
``` | ||
|
||
### 28.3.3 `Number.isNaN` | ||
|
||
전달된 숫자값이 NaN인지 검사하여 그 결과를 불리언 값으로 반환한다. | ||
|
||
```jsx | ||
Number.isNaN(NaN); // true | ||
``` | ||
|
||
**빌트인 전역 함수 `isNaN`과 비교** | ||
|
||
- `isNaN`은 전달받은 인수를 숫자로 암묵적 타입 변환하여 검사를 수행한다. | ||
- `Number.isNaN`은 전달받은 인수를 숫자로 암묵적 타입 변환하지 않는다. 따라서 숫자가 아닌 인수가 주어졌을 때 반환값은 언제나 false다. | ||
|
||
```jsx | ||
Number.isNaN(undefined); // false | ||
|
||
// undefined는 NaN으로 암묵적 타입 변환된다. | ||
isNaN(undefined); // true | ||
``` | ||
Comment on lines
+136
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Number.isNaN 은 진짜 NaN 인 것만 true이고, isNaN은 falsy나 truthy 마냥 Number가 아닌 것(Not-a-Number)을 true로 취급하더라고요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 잼있게 알아보는 JS null/undefined/NaN 여기에 나오는 사진 비유가 너무 웃겨요ㅋㅋㅋㅋㅋ |
||
|
||
### 28.3.4 `Number.isSafeInteger` | ||
|
||
인수로 전달된 숫자값이 안전한 정수인지 검사하여 그 결과를 불리언 값으로 반환한다. 검사전에 인수를 숫자로 암묵적 타입 변환하지 않는다. | ||
|
||
```jsx | ||
Number.isSafeInteger(0) // true | ||
Number.isSageInteger(Number.MAX_SAFE_INTEGER) // true | ||
Number.isSageInteger(Number.MAX_SAFE_INTEGER+1) // false | ||
``` | ||
|
||
### 28.3.5 `Number.prototype.toExponential` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Number에 바로 붙어있는 메서드와 Number.prototype 안에 들어있는 메서드의 차이가 뭘까요?? 초기에 추가되고 나중에 추가된 것의 차이일까요?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 앞의 클래스 단원에서 나온 내용 복습할 겸 정리해요.
const num = 100;
num.toExponential() // 프로토타입 체이닝을 통해 호출 가능
num.isSafeIntiger() // 정의되어 있지 않음 이런 기술적인 분류와 별개로 어떤 이유로 인스턴스 메소드와 정적 메소드를 나눴는지 생각을 조금 해봤는데 |
||
|
||
숫자를 지수 표기법으로 변환하여 문자열로 반환한다. | ||
|
||
지수 표기법이란 매우 크거나 작은 숫자를 표기할 때 주로 사용하며 e(Exponent) 앞에 있는 숫자에 10의 n승을 곱하는 형식으로 수를 나타내는 방식이다. 인수로는 소수점 이하로 표현할 자릿수를 전달할 수 있다. | ||
|
||
```jsx | ||
(77.1234).toExponential(); // '7.71234e+1' | ||
// 인수를 전달하지 않으면 전체 숫자를 반영한 지수 표기법을 사용한다. | ||
|
||
(77.1234).toExponential(4); // '7.7123e+1' | ||
(77.1234).toExponential(2); // '7.71e+1' | ||
``` | ||
|
||
### 28.3.6 `Number.prototype.toFixed` | ||
|
||
인수로 전달받은 소수점 이하 자리수까지 유효하도록 나머지 자릿수를 반올림하여 문자열로 반환한다. | ||
|
||
소수점 이하가 주어진 인수보다 길면 숫자를 반올림하고, 짧아서 부족할 경우 뒤를 0으로 채운다. 인수는 0~20 사이의 정수값이며 기본값은 0이다. | ||
|
||
```jsx | ||
var numObj = 12345.6789; | ||
|
||
// 소수점 이하 반올림. | ||
numObj.toFixed(); // '12346' | ||
|
||
// 소수점 이하 1자릿수 유효, 나머진 반올림 | ||
numObj.toFixed(1); // '12345.7' | ||
|
||
// 소수점 이하 6자릿수 유효, 부족한 부분은 0으로 채움 | ||
numObj.toFixed(6); // '12345.678900' | ||
``` | ||
|
||
### 28.3.7 `Number.prototype.toPrecision` | ||
|
||
인수로 전달받은 전체 자릿수까지 유효하도록 나머지 자릿수를 반올림하여 문자열로 반환한다. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 유효숫자를 배우지 않아서 항상 에타에 올라올 때마다 이게 뭔가 했는데 그냥 지수 표현식같은 거였군요 |
||
|
||
인수로 전달받은 전체 자릿수로 표현할 수 없는 경우 지수 표기법으로 결과를 반환한다. 인수는 0~21 사이의 정수값이며 기본값은 0이다. | ||
|
||
```jsx | ||
var numObj = 12345.6789; | ||
|
||
numObj.toPrecision(); // '12345.6789' | ||
|
||
numObj.toPrecision(1); //'1e+4' | ||
numObj.toPrecision(2); // '1.2e+4' | ||
|
||
numObj.toPrecision(5); // '12346' | ||
``` | ||
|
||
| 특징 | `toFixed(digits)` | `toPrecision(precision)` | | ||
| --- | --- | --- | | ||
| 역할 | 소수점 이하 자릿수를 지정 | 전체 자릿수를 지정 | | ||
| 인자 | `digits`: 소수점 이하 유지할 자릿수 (0~100) | `precision`: 전체 유효 숫자 개수 (1~100) | | ||
| 반올림 여부 | 지정한 소수점 이하 자릿수에서 반올림 | 지정한 유효 숫자 개수에서 반올림 | | ||
| 지수 표기법 사용 | 사용하지 않음 (항상 고정 소수점) | 필요 시 지수 표기법 사용 | | ||
| 기본값 | `toFixed(0)`이면 정수 부분만 출력 | `toPrecision()` 호출 시 기본적으로 전체 유효 숫자를 출력 | | ||
| 사용 예시 | 화폐 단위처럼 소수점 이하 자릿수를 고정해야 할 때 | 과학 계산에서 정확한 유효 숫자 개수를 유지해야 할 때 | | ||
|
||
### 28.3.8 `Number.prototype.toString` | ||
|
||
숫자를 문자열로 변환하여 반환한다. | ||
|
||
진법을 나타내는 2~36 사이의 정수값을 인수로 전달할 수 있고, 기본값은 10이다. | ||
|
||
```jsx | ||
(10).toString(); // '10' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 인스턴스 메소드 이렇게 사용하는 거 처음 봐요 ㄷㄷ |
||
(3).toString(2); // '11' | ||
``` | ||
|
||
### 숫자 리터럴과 함께 Number 프로토타입 메서드 | ||
|
||
를 사용할 경우 에러가 발생한다. | ||
|
||
```jsx | ||
77.toExponential(); // SyntaxError: Invalide or unexpected token | ||
``` | ||
|
||
점(.)은 소수 구분 기호 또는 프로퍼티 접근 연산자로 사용될 수 있는데, 자바스크립트 엔진이 숫자 뒤의 .을 소수 구분 기호로 해석해버려 toExponential()을 프로퍼티로 해석하지 못하기 때문이다. | ||
|
||
**해결 방법** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이런 방법들이 있었군요! |
||
|
||
1. 숫자 리터럴에 괄호를 씌우기 | ||
|
||
```jsx | ||
(77).toExponential(); | ||
``` | ||
|
||
숫자 리터럴을 괄호로 감싸면 점(.)이 메서드 호출 연산자로 정확히 해석됨. | ||
|
||
2. 숫자 뒤에 .을 붙이기 | ||
|
||
```jsx | ||
77.1234.toExponential(); | ||
77..toExponential(); | ||
``` | ||
|
||
첫 번째 .은 부동 소수점 숫자의 소수 구분 기호로 보고, 숫자에 소수점은 하나만 존재하므로 두 번째 .은 프로퍼티 접근 연산자로 해석된다. | ||
|
||
3. 숫자 뒤에 공백을 추가 | ||
|
||
```jsx | ||
77 .toExponential(); | ||
``` | ||
|
||
자바스크립트 숫자는 정수 부분과 소수 부분 사이에 공백을 포함할 수 없기 때문에 숫자와 . 사이에 공백이 오면 .을 프로퍼티 접근 연산자로 해석한다. | ||
Comment on lines
+228
to
+263
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 와 이 부분은 진짜진짜 처음 보네요
역시 개발자들이 코드를 어떻게 짜도 알아서 해석해서 일단 돌아가게 해주는 JS..~~! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 진짜 신기함 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 숫자 뒤에 공백 추가하면 되는게 더 어이없어여 ㅋㅋㅋㅋㅋ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Math | ||
|
||
표준 빌트인 객체인 Math는 수학적인 상수와 함수를 위한 프로퍼티와 메서드를 제공한다. | ||
|
||
Math는 생성자 함수가 아니기 때문에 정적 프로퍼티와 정적 메서드만 제공한다. | ||
|
||
# 29.1 Math 프로퍼티 | ||
|
||
## 29.1.1 Math.PI | ||
|
||
원주율 $\pi$값(≈3.141592653589793)을 반환한다. | ||
|
||
# 29.2 Math 메서드 | ||
|
||
## 29.2.1 Math.abs | ||
|
||
인수로 전달된 숫자의 절대값을 반환한다. | ||
|
||
## 29.2.2-29.2.4 어림 메서드 | ||
|
||
| Math.round() | Math.ceil() | Math.floor() | Math.trunc() | | ||
| --- | --- | --- | --- | | ||
| 소수점 첫째 자리에서 반올림 | 소수점 이하 올림 | 소수점 이하 내림 | 소수점 이하 버림 | | ||
| 가장 가까운 정수 선택 | `+` 방향으로 가까운 정수 선택 | `-` 방향으로 가까운 정수 선택 | 0의 방향으로 가까운 정수 선택 | | ||
Comment on lines
+21
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 코딩 테스트 문제를 풀 때, 소수점을 버려야 하는 경우 console.log(Math.floor(3.14)); // 3
console.log(~~3.14); // 3 이 원리는 비트 NOT( console.log(~5); // -6 (비트 반전)
console.log(~~5); // 5 (비트 반전 후 다시 반전 → 정수 변환) 이를 활용하면 다만 음수인 경우에는 여러분은 자주 사용하시나요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 알고리즘 문제를 js로 풀어보지 않아서 몰랐는데 |
||
|
||
```jsx | ||
Math.round(2.1) // 2 | ||
Math.round(-2.6) // -3 | ||
|
||
Math.ceil(2.1) // 3 | ||
Math.ceil(-2.6) // -2 | ||
|
||
Math.floor(2.1) // 2 | ||
Math.floor(-2.6) // -3 | ||
|
||
Math.trunc(2.1) // 2 | ||
Math.trunc(-2.6) // -2 | ||
``` | ||
|
||
## 29.2.5 Math.sqrt | ||
|
||
인수로 전달된 숫자의 제곱근을 반환한다. | ||
|
||
```jsx | ||
Math.sqrt(9); // 3 | ||
Math.sqrt(-9); // NaN | ||
Math.sqrt(2); // 1.414213562373095 | ||
``` | ||
|
||
## 29.2.6 Math.random | ||
|
||
임의의 난수(랜덤 숫자)를 반환한다. 0 이상 1 미만의 실수이다. | ||
|
||
## 29.2.7 Math.pow | ||
|
||
첫 번째 인수를 밑으로, 두 번째 인수를 지수로 거듭제곱한 결과를 반환한다. | ||
|
||
```jsx | ||
Math.pow(2,3); // 8 | ||
Math.pow(2,-1); // 0.5 | ||
Math.pow(2) // NaN | ||
|
||
Math.pow(0,0); // 1로 취급 | ||
``` | ||
|
||
## 29.2.8 Math.max | ||
|
||
전달받은 인수 중에서 가장 큰 수를 반환한다. 인수가 전달되지 않으면 `Infinity`를 반환한다. | ||
|
||
배열을 인수로 전달받아 배열의 요소 중에서 최대값을 구하려면 `Function.prototype.apply` 메서드 또는 스프레드 문법을 사용해서 개별 인자로 분해해야 한다. | ||
|
||
```jsx | ||
Math.max(1, 2, 3) // 3 | ||
|
||
Math.max.apply(null, [1, 2, 3]); // 3 | ||
Math.max(...[1, 2, 3]); // 3 | ||
``` | ||
|
||
## 29.2.9 Math.min | ||
|
||
전달받은 인수 중에서 가장 작은 수를 반환한다. 인수가 전달되지 않으면 `Infinity`를 반환한다. | ||
|
||
```jsx | ||
Math.min(1, 2, 3) // 1 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 첨알았네요 그냥 대충 썼었는데..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Number(): type이 number인 숫자를 반환
new Number(): type이 object인 Number 인스턴스 반환
만약 우리가 문자열 '123'을 숫자로 변환하고자 한다면 그냥 Number('123')을 해도 괜찮을 것 같다는 생각입니다.
단순 원시값으로 변환해도 Number 인스턴스의 메서드들은 래퍼 객체를 통해 사용할 수 있으니까요!
래퍼객체에 대한 자세한 내용은 조은님이 지난번에 정리해주신 21장 빌트인 객체 에서 다루고 있습니다!