Math.sign()
function returns the sign of the value, indicating whether a number is positive, negative, or zero. It the following values:1
- for positive numbers-1
- for negative numbers0
- for positive zero-0
- for negative zeroNaN
- in all other casesnumber
type implicitly.