dec-int
Returns a base-10 integer from a NumericString or Number. Returns NaN
if input
can't be coerced
to an integer.
// => 56
What is a NumericString?
Anything that would be a number if it didn't have quotes around it. For example, these are all numeric strings:
'5' or "5"
'123.456' or "123.456"
'-0' or "-0"
'0xFFFFFF' or "0xFFFFFF"
'020' or "020"
However, these are examples of what's not a NumericString:
"Infinity"
"Math.PI"
"PI"
"e"
Note: any input that is equivalent to negative-zero (except negative-zero itself) will evaluate to positive-zero. For example:
; // => 0; // => -0; // => 0; // => 0