Covert a long string to number

Viewed 90

Want to convert a string to a number. I tried Number(), parseInt() but the result is like, if the string is "586486785469547948790470945870879003409" the result is => 5.8648678546954796e+38 How to covert is as a number without using mathematical notations

2 Answers

using built-in (BigInt or Number)

const bigNum= BigInt(//number)
const bigNum= Number(//number)
Related