Open mdhornet90 opened 4 years ago
Numerous advancements in the javascript language, particularly performance improvements in the parser, have made this kind of code portable enough that it no longer needs to be a library function. Recommend deprecating this library.
There is a migration path for vanilla JS available also:
let sgn = x => x > 0 ? 1 : x < 0 ? -1 : 0; console.log(sgn(100)); console.log(sgn(-100)); console.log(sgn(Infinity));
This package is just Math.sign
Math.sign
Numerous advancements in the javascript language, particularly performance improvements in the parser, have made this kind of code portable enough that it no longer needs to be a library function. Recommend deprecating this library.