mardi 25 août 2020

TypeError: Cannot mix BigInt and other types, use explicit conversions

I am trying to generate a 20 digit random number:

let code = Math.floor(10000000000000000000n + Math.random() * 90000000000000000000n)

I have tried putting the numbers in BigInt() as well as adding a n after but still this error comes.

Uncaught TypeError: Cannot mix BigInt and other types, use explicit conversions



Aucun commentaire:

Enregistrer un commentaire