main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
320 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | // `Math.sign` method implementation
|
---|
3 | // https://tc39.es/ecma262/#sec-math.sign
|
---|
4 | // eslint-disable-next-line es/no-math-sign -- safe
|
---|
5 | module.exports = Math.sign || function sign(x) {
|
---|
6 | var n = +x;
|
---|
7 | // eslint-disable-next-line no-self-compare -- NaN check
|
---|
8 | return n === 0 || n !== n ? n : n < 0 ? -1 : 1;
|
---|
9 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.