JS BigInt.valueOf()
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 | Status |
|---|---|
| BigInt | Stage 3 |