This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2020.
The valueOf() method of BigInt values returns the wrapped primitive value of a BigInt object.
console.log(typeof Object(1n)); // Expected output: "object" console.log(typeof Object(1n).valueOf()); // Expected output: "bigint"
valueOf()
None.
A BigInt representing the primitive value of the specified BigInt object.
valueOf
typeof Object(1n); // object typeof Object(1n).valueOf(); // bigint
| Desktop | Mobile | Server | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | Bun | Deno | Node.js | |
valueOf |
67 | 79 | 68 | 54 | 14 | 67 | 68 | 48 | 14 | 9.0 | 67 | 14 | 1.0.0 | 1.0 | 10.4.0 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/valueOf