Difference between BigInt and bigint in javascript/typescript [duplicate]
Asked Answered
X

0

1

I'm still learning typescript/javascript and now I'm trying to replace existing code where BigNumber is used with bigint/BigInt.

Originally I thought these types are the same (because typeof(BigInt) === typeof(bigint)) but when accidentaly mixed bigint and BigInt I received errors from typescript compiler.

I see that ethers.js is using bigint so I can't use BigInt. So is bigint the correct way how to use native big nubmers in JS?

Thanks

Checked documentations, checked SO, asked chat AI ;-)

Xena answered 22/1, 2023 at 17:36 Comment(1)
"typeof(BigInt) === typeof(bigint)" - no it's not?Alti

© 2022 - 2024 — McMap. All rights reserved.