The Math.sign()
function returns either a positive or negative +/- 1, indicating the sign of a number passed into the argument. If the number passed into Math.sign()
is 0, it will return a +/- 0. Note that if the number is positive, an explicit (+) will not be returned.