Recommend Sunsetting
mdhornet90 opened this issue · 2 comments
mdhornet90 commented
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.
soaxelbrooke commented
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));