I was debugging on chrome console and found this error. Basically,
Math.ceil(0.1); // Works
Math.ceil(00.1); // Doesn't work
Any reason / thoughts for this?
Thanks.
I was debugging on chrome console and found this error. Basically,
Math.ceil(0.1); // Works
Math.ceil(00.1); // Doesn't work
Any reason / thoughts for this?
Thanks.
Decimal literals can only start with a single 0
. From the spec, a NumericLiteral is a DecimalLiteral, BinaryIntegerLiteral, OctalIntegerLiteral, or HexIntegerLiteral. Yours is a DecimalLiteral because it includes a .
. That can have only one leading zero.
Here are the linked rules:
NumericLiteral::
DecimalLiteral
BinaryIntegerLiteral
OctalIntegerLiteral
HexIntegerLiteral
Yours is a DecimalLiteral because of the .
, which is:
DecimalLiteral::
DecimalIntegerLiteral . DecimalDigitsopt ExponentPartopt
. DecimalDigitsopt ExponentPartopt
DecimalIntegerLiteral ExponentPartopt
...where
DecimalIntegerLiteral::
0
NonZeroDigit DecimalDigitsopt
and
DecimalDigits::
DecimalDigit
DecimalDigits DecimalDigit
and
DecimalDigit:: one of
0 1 2 3 4 5 6 7 8 9