by clemens (06.10.2021)

Use the unary plus operator in JS to parse numbers


Of the dozens of variants to parse a number in JS, the unary plus operator is the preferred method.

My first impression was that this is just syntactic sugar for parseFloat(), but this is not the case.

Also have a look here for even more variants to parse a number….