Constructeur BigInt()
Le constructeur BigInt()
renvoie une valeur de type bigint
(grand entier).
Syntaxe
js
BigInt(valeur);
Paramètres
valeur
-
La valeur numérique de l'objet à créer. Il peut s'agir d'une chaîne de caractères ou d'un entier.
Note : BigInt()
ne s'utilise pas avec l'opérateur new
.
Exemples
Créer un nouveau grand entier
js
BigInt(123);
// 123n
Spécifications
Specification |
---|
ECMAScript Language Specification # sec-bigint-constructor |
Compatibilité des navigateurs
BCD tables only load in the browser