Why 1..toString() return "1" in JavaScript?
The expression 1..toString() returns the string "1". Here's how it works:
1. 1. (the first . after 1): This is treated as part of the numeric literal. JavaScript requires the second . to distinguish between a floating-point number and a method call. If you just wrote 1.