I am currently writing a piece of JavaScript that uses base 36 encoding.
I came across this problem:
parseInt("welcomeback",36).toString(36)
Appears to return "welcomebacg"
.
I tested this in the Chrome developer's console and Node.js with the same result.
Is there any logical explanation for this result?
number
can accurately represent (2^53, but your value is in the order of 36^11) Try using the newerBigInt
type instead ofnumber
. – Ardie