completed exercise 3.1

This commit is contained in:
counterweight 2025-05-31 22:51:30 +02:00
parent 68aa0e9905
commit 0bd43956c9
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
604 changed files with 67855 additions and 0 deletions

View file

@ -0,0 +1,11 @@
'use strict';
var $isNaN = require('./isNaN');
/** @type {import('./sign')} */
module.exports = function sign(number) {
if ($isNaN(number) || number === 0) {
return number;
}
return number < 0 ? -1 : +1;
};