sign()

Determines whether a value is positive, negative, a form of zero (-0 or 0) or not a number.

This function is valid in v2.15.0 to v2.24.3. This function has been downloaded 57 times.

Parameter

{number} x
Value that should be interpreted as a number to determine if it is positive or negative.

Returns

{number}
Returns NaN if x isn't recognized as a number. If x is zero x will be returned. If x is negative -1 is returned, otherwise 1 is returned.