
console.log(parseInt("110000111010000011100101010001010101000100000000000000000001111", 2));
The output result was wrong, even it is in google browser console.
The correct output is 7048259459772055567
I think the number is too big so nodejs cannot solve it?
>Solution :
Indeed, that number is much larger than Number.MAX_SAFE_INTEGER, so it cannot be accurately represented. You can use BigInts to work with numbers of this scale.
let str = "110000111010000011100101010001010101000100000000000000000001111";
let n = BigInt('0b' + str);
console.log('' + n);