.sign()

Description

Sign returns the sign of the input value (+ or -) based on if it is positive or negative.

Parameters

Sign takes no parameters

Usage On Numbers

num = 1.2

log num.sign()
// returns "+"

num = -5

log num.sign()
// returns "-"

Last updated