DEV Community

Discussion on: .toLocaleString, one of the most underrated JavaScript features

Collapse
 
ricky11 profile image
Rishi U

awesome, why the .. for some items and not others?

Collapse
 
siddharthshyniben profile image
Siddharth • Edited

In JavaScript, you can't directly access properties on numbers. You can either use 2 dots or braces instead

10.toString() // error
(10).toString() // ok
10..toString() // ok
Enter fullscreen mode Exit fullscreen mode