Why does a method like `toString` require two dots after a number?

Viewed 1090

What is the logic behind 42..toString() with ..?

The double dot works and returns the string "42", whereas 42.toString() with a single dot fails.

Similarly, 42...toString() with three dots also fails.

Can anyone explain this behavior?

console.log(42..toString());

console.log(42.toString());

3 Answers
Related