sign

The Math.sign() method returns if x is negative, null or positive (-1, 0, 1)

Syntax

Math.sign()

Returns

-1, 0, 1

Parameters

x (float)
A number.