convertToNumber
Converts this expression to a number.
If this expression is null
or false
, the result is 0
. If this is true
, the result is 1
. If the input is a string, it is converted to a number as specified by the "ToNumber Applied to the String Type" algorithm of the ECMAScript Language Specification.
In case this expression cannot be converted to a number, each of the fallbacks is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.