Further from what @Soupedenuit said, there is a shorthand that you might see - you can use the unary
+ operator to do the same thing:
It saves quite a bit of typing if you need to ensure a lot of stuff that is coming in as strings get converted to real numbers, which happens in particular when you read values from HTML attributes.
In a related note, if you want to ensure that the numbers are all integers
> 1 | 0
> 1.234 | 0
> '12.34' | 0
(this is how the precursor to WebAssembly, ASM (and Emscripten, the C/C++ -> JS compiler, amongst other things), ensures actual integers even though JS only has floating point)