Why the first line below gives error although the second and third lines work fine?
1.toString(); // SyntaxError (1).toString(); // OK 1[\'toString\'](); //
The . presents ambiguity. Is it a decimal, or a property accessor?
.
The interpreter sees it as a decimal, so you can use .. to allow both the decimal, then the property syntax.
..
1..toString();
Or use one of the other ways you show to resolve the ambiguity.