I found myself in the situation where I wanted to convert a BigInt value to a Number value. Knowing that my value is a safe integer, how can I convert it?
BigInt
Number
Turns out it's as easy as passing it to the Number constructor:
const myBigInt = BigInt(10); // of course, `10n` also works const myNumber = Number(myBigInt);
1.4m articles
1.4m replys
5 comments
57.0k users