Why the first line below gives error although the second and third lines work fine?
1.toString(); // SyntaxError (1).toString(); // OK 1[\'toString\'](); //
The parser is trying to treat 1. as the start of a floating-point literal -- only toString turns it into an invalid number.
1.
toString
Compare with:
1.0.toString()