| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/BigInt/toString | [Back] [Original] |
Get to know MDN better
console.log(1024n.toString());
// : "1024"
console.log(1024n.toString(2));
// : "10000000000"
console.log(1024n.toString(16));
// : "400"
toString()
toString(radix)
radix 2 36 10
RangeErrortoString() 2 36
BigInt Object toString() Object.prototype.toString() BigInt toString()
10 9 16 16 a f
2 2 - 2
toString() this BigInt this TypeError
BigInt [Symbol.toPrimitive]() JavaScript BigInt toString() JavaScript BigInt toString() BigInt toString() toString()
BigInt.prototype.toString = () => "Overridden";
console.log(`${1n}`); // "1"
console.log(`${Object(1n)}`); // "Overridden"
17n.toString(); // "17"
66n.toString(2); // "1000010"
254n.toString(16); // "fe"
(-10n).toString(2); // "-1010"
(-0xffn).toString(2); // "-11111111"
0 BigInt 0 -0.0 JavaScript NumberIEEE
(-0n).toString(); // "0"
BigInt(-0).toString(); // "0"
| ECMAScript 2027 LanguageSpecification # sec-bigint.prototype.tostring |
| Web Proxy Viewer | New URL | Original Page |