BigInt.prototype.valueOf()

The valueOf() method returns the wrapped primitive value of a BigInt object.

Syntax

bigIntObj.valueOf()

Return value

A BigInt representing the primitive value of the specified BigInt object.

Examples

Using valueOf

typeof Object(1n); // object
typeof Object(1n).valueOf(); // bigint

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
valueOf
67
79
68
No
54
14
67
67
68
48
14
9.0

See also

© 2005–2021 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