• Skip to main content
  • Skip to search
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. JavaScript
  3. JavaScript reference
  4. Standard built-in objects
  5. BigInt
  6. BigInt() constructor
  • Change language

Table of contents

  • Syntax
  • Examples
  • Specifications
  • Browser compatibility
  • See also

BigInt() constructor

The BigInt() constructor returns a value of type bigint.

Syntax

BigInt(value);

Parameters

value
The numeric value of the object being created. May be a string or an integer.

Note: BigInt() is not used with the new operator.

Examples

Creating a new BigInt

BigInt(123);
// 123n

Specifications

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

Browser compatibility

BCD tables only load in the browser

See also

  • BigInt class

Found a problem with this page?

  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Feb 19, 2021, by MDN contributors

Change your language

Related Topics

  1. Standard built-in objects
  2. BigInt
  3. Methods
    1. BigInt.asIntN()
    2. BigInt.asUintN()
    3. BigInt.prototype.toLocaleString()
    4. BigInt.prototype.toString()
    5. BigInt.prototype.valueOf()
  4. Inheritance:
  5. Function
  6. Properties
    1. This deprecated API should no longer be used, but will probably still work. Function.arguments
    2. This deprecated API should no longer be used, but will probably still work. Function.caller
    3. This API has not been standardized. Function.displayName
    4. Function.length
    5. Function.name
  7. Methods
    1. Function.prototype.apply()
    2. Function.prototype.bind()
    3. Function.prototype.call()
    4. This API has not been standardized. This is an obsolete API and is no longer guaranteed to work. Function.prototype.toSource()
    5. Function.prototype.toString()
  8. Object
  9. Properties
    1. Object.prototype.constructor
    2. This deprecated API should no longer be used, but will probably still work. Object.prototype.__proto__
  10. Methods
    1. This deprecated API should no longer be used, but will probably still work. Object.prototype.__defineGetter__()
    2. This deprecated API should no longer be used, but will probably still work. Object.prototype.__defineSetter__()
    3. This deprecated API should no longer be used, but will probably still work. Object.prototype.__lookupGetter__()
    4. This deprecated API should no longer be used, but will probably still work. Object.prototype.__lookupSetter__()
    5. Object.prototype.hasOwnProperty()
    6. Object.prototype.isPrototypeOf()
    7. Object.prototype.propertyIsEnumerable()
    8. Object.setPrototypeOf()
    9. Object.prototype.toLocaleString()
    10. This API has not been standardized. This is an obsolete API and is no longer guaranteed to work. Object.prototype.toSource()
    11. Object.prototype.toString()
    12. Object.prototype.valueOf()
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

Mozilla

© 2005-2021 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies