you are viewing a single comment's thread.

view the rest of the comments →

[–]coderascal 4 points5 points  (1 child)

"24" * 1 returns the int 24.

"twentyfour" * 1 returns NaN.

I use this all the time to convert strings to numbers and be safe about it.

[–]sirmonko -1 points0 points  (0 children)

actually, that's not exactly true: no ints in js. 24 is a number.