Web/JavaScript/Reference/Global objects/BigInt/valueOf

From Get docs


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


The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

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

Specification
ECMAScript (ECMA-262)The definition of 'BigInt.prototype.valueOf()' in that specification.

Browser compatibility

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

Update compatibility data on GitHub

Desktop Mobile Server
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet Node.js
valueOf Chrome

Full support 67

Edge

Full support 79

Firefox

Full support 68

IE

No support No

Opera

Full support 54

Safari

Full support 14

WebView Android

Full support 67

Chrome Android

Full support 67

Firefox Android

Full support 68

Opera Android

Full support 48

Safari iOS

Full support 14

Samsung Internet Android

Full support 9.0

nodejs

Full support 10.4.0

Legend

Full support  
Full support
No support  
No support


See also