It works with a lot of types, but not with hexadecimal or binary. Also, Number(octal)does not analyze the octal number.
Number("15") === 15;
Number("-15") === -15;
Number("0x10") === 16;
Number("0b10") === 2;
Number("-0x10") === NaN;
Number("-0b10") === NaN;
Number("0777") === 777;
Number("-0777") === -777;
Question : How to properly analyze all valid Javascript numbers?
Change A
parseInt()don’t help me because I need to check every opportunity (if I start with 0x, I use 16, for example).
Change B
Chrome 0777, 511, . , javascript-. , javascript. , , , 0 - Number(hex) , Number(-hex). .