Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. JavaScript
  3. Reference
  4. Standard built-in objects
  5. BigInt
  6. valueOf()

BigInt.prototype.valueOf()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨September 2020⁩.

ThevalueOf() method ofBigInt values returns the wrapped primitive valueof aBigInt object.

Try it

console.log(typeof Object(1n));// Expected output: "object"console.log(typeof Object(1n).valueOf());// Expected output: "bigint"

Syntax

js
valueOf()

Parameters

None.

Return value

A BigInt representing the primitive value of the specifiedBigInt object.

Examples

UsingvalueOf

js
typeof Object(1n); // objecttypeof Object(1n).valueOf(); // bigint

Specifications

Specification
ECMAScript® 2026 Language Specification
# sec-bigint.prototype.valueof

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp