| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Guide/Data_structures#bigint_type | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
, . JavaScript . .
JavaScript . JavaScript , ( ) .
let foo = 42; // foo
foo = "bar"; // foo
foo = true; // foo
const foo = 42; // foo .
const result = foo + "1"; // JavaScript foo , .
console.log(result); // 421
, , (: , ) (footgun) . BigInts , JavaScript .
Object . ' ' .
null typeof . typeof null "object" === null null .
null undefined , . , Number toExponential() . , JavaScript . null undefined , TypeError .
| Type | typeof return value |
Object wrapper |
|---|---|---|
| Null | "object" |
N/A |
| Undefined | "undefined" |
N/A |
| Boolean | "boolean" |
Boolean |
| Number | "number" |
Number |
| BigInt | "bigint" |
BigInt |
| String | "string" |
String |
| Symbol | "symbol" |
Symbol |
, .
Null null .
Undefined undefined .
, undefined , null .
(typeof null === "object" ). undefined.
return(return;) undefined .obj.iDontExist) undefined .let x;) undefined .Array.prototype.find() Map.prototype.get() , undefined .null . prototype chain . , Object.getPrototypeOf(), Object.create() undefined null .
null , undefined . undefined .
Boolean true false .
Number 64 IEEE 754 . 2-1074 (Number.MIN_VALUE) 21024 (Number.MAX_VALUE) , -2-1074 -21024 , -(253 1) (Number.MIN_SAFE_INTEGER) 253 1 (Number.MAX_SAFE_INTEGER) . , JavaScript . . Number.isSafeInteger() .
(2-1074 to 21024) .
Number.MAX_VALUE +Infinity .Number.MIN_VALUE +0 .Number.MAX_VALUE -Infinity .Number.MIN_VALUE -0 .+Infinity -Infinity , . Number.POSITIVE_INFINITY Number.NEGATIVE_INFINITY .
Number . 0 -0 +0 ( 0 +0 ). , . , +0 === -0 true. , 0 .
console.log(42 / +0); // Infinity
console.log(42 / -0); // -Infinity
NaN ("Not a Number") , . , "NaN" JavaScript .
, . .
BigInt JavaScript . BigInt Number (Number.MAX_SAFE_INTEGER) .
BigInt n BigInt() .
// BigInt
const x = BigInt(Number.MAX_SAFE_INTEGER); // 9007199254740991n
x + 1n === x + 2n; // 9007199254740992n 9007199254740993n false.
// Number
Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2; // 9007199254740992 true.
+, *, -, **, % BigInt . >>> . BigInt Number .
BigInt , , BigInt . , . TypeError BigInt .
String , UTF-16 16 . String String . 0, 1 . String UTF-16 , . String .
JavaScript String . , String . String String String . , .
substring() String String .+) concat() ., .
responseText XMLHttpRequest ) ., . . , ( JavaScript ) . . , ... .
. .
Symbol ( ) . "" . .
. JavaScript . Functions callable .
JavaScript . , . - . strings symbols . .
. ''(attribute) . JavaScript , Object.defineProperty() , Object.getOwnPropertyDescriptor() .
, .
valueget . JavaScript .
writable.
enumerableA boolean value indicating if the property can be enumerated by a for...in loop. See also Enumerability and ownership of properties for how enumerability interacts with other functions and syntaxes.
for...in . .
configurable, , .
(get, set) .
: '' '' . JavaScript , .
.
get get . getters . undefined .
set . . setters . undefined .
enumerable for...in . .
configurable, , .
prototype null . , [[Prototype]] . [[Prototype]] .
JavaScript Date .
, Array.prototype . , indexOf() , push() . .
(Typed Arrays) , . "( )Typed Array" Int8Array, Float32Array . typed array . Typed Array ArrayBuffer DataView .
Map Set . (<, '' ) , , . (WeakMap ) .
DOM data-* , . Map WeakMap .
JSON(JavaScript Object Notation) , JavaScript . JSON . JSON .
, JavaScript . , , . , JavaScript .
, . [@@toPrimitive]() ( "default" ), valueOf(), toString() . toString() valueOf() , , string .
[@@toPrimitive]() , . TypeError . valueOf() toString() , . , TypeError . .
console.log({} + []); // "[object Object]"
{} [] [@@toPrimitive]() . {} [] Object.prototype.valueOf valueOf() . . toString() . {}.toString() "[object Object]" , [].toString() "" , "[object Object]".
[@@toPrimitive]() . valueOf() , . [@@toPrimitive]() . Date Symbol [@@toPrimitive]() . Date.prototype[@@toPrimitive]() "default" "string" , Symbol.prototype[@@toPrimitive]() (symbol) .
Number BigInt . BigInt(: Array.prototype.slice()) . , . BigInt .
BigInt TypeError (number coercion) . Number BigInt , . .
Null, Undefined Symbol . string , (boolean) .
, .
[@@toPrimitive]("default") valueOf() toString()[@@toPrimitive]("number") valueOf() toString()[@@toPrimitive]("string") toString() valueOf() , [@@toPrimitive]() , , valueOf toString . , . .
This page was last modified on 2025 10 9 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |