How to get the sign of a number in JavaScript

1 Answer

0 votes
console.log(Math.sign(-7));
console.log(Math.sign(0));
console.log(Math.sign(89));




/*
run:
     
-1
0
1
   
*/

 



answered Mar 12, 2020 by avibootz
...