peach a19a732be8 commit message | il y a 2 ans | |
---|---|---|
.. | ||
.github | il y a 2 ans | |
test | il y a 2 ans | |
.editorconfig | il y a 2 ans | |
.eslintignore | il y a 2 ans | |
.eslintrc | il y a 2 ans | |
.nycrc | il y a 2 ans | |
CHANGELOG.md | il y a 2 ans | |
LICENSE | il y a 2 ans | |
README.md | il y a 2 ans | |
index.js | il y a 2 ans | |
package.json | il y a 2 ans |
Is this value negative zero? === will lie to you.
var isNegativeZero = require('is-negative-zero');
var assert = require('assert');
assert.notOk(isNegativeZero(undefined));
assert.notOk(isNegativeZero(null));
assert.notOk(isNegativeZero(false));
assert.notOk(isNegativeZero(true));
assert.notOk(isNegativeZero(0));
assert.notOk(isNegativeZero(42));
assert.notOk(isNegativeZero(Infinity));
assert.notOk(isNegativeZero(-Infinity));
assert.notOk(isNegativeZero(NaN));
assert.notOk(isNegativeZero('foo'));
assert.notOk(isNegativeZero(function () {}));
assert.notOk(isNegativeZero([]));
assert.notOk(isNegativeZero({}));
assert.ok(isNegativeZero(-0));
Simply clone the repo, npm install
, and run npm test