Math.sign( ) Function
The Math.sign() is a builtin function in JavaScript and is used to know the sign of a number, indicating whether the number specified is negative or positive.
Return Value: The Math.sign() function returns five different values as described below:
It returns 1 if the argument passed is a positive number.
It returns -1 if the argument passed is a negative number.
It returns 0 if the argument passed is a positive zero.
It returns -0 if the argument passed is a negative zero.
If none of the above cases match,it returns Nan.
Last updated