math-sign-x
Shim for Math.sign.
module.exports(x)
⇒ *
⏏
math-sign-x
⇒ number
This method returns the sign of a number, indicating whether the number is positive, negative or zero. (ES2019)
Kind: static property of math-sign-x
Returns: number
- A number representing the sign of the given argument. If the argument
is a positive number, negative number, positive zero or negative zero, the function will
return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
Param | Type | Description |
---|---|---|
x | * |
A number. |
Example
; console; // 1console; // -1console; // -1console; // 0console; // -0console; // NaNconsole; // NaNconsole; // NaN