Utils.getSign()

Return the sign (-1, 1 or 0) of the number given as parameter

Parameters

NameTypeDescription
1xnumber

Return value

number

the sign

Usage

import {Utils} from '@lcluber/type6js';

console.log(Utils.getSign(2)); //1
console.log(Utils.getSign(-2)); //-1
console.log(Utils.getSign(0)); //0