is-nan

ES6-compliant shim for Number.isNaN - the global isNaN returns false positives.

#is-nan

ES6-compliant shim for Number.isNaN - the global isNaN returns false positives.

Number.isNaN = require('is-nan');
var assert = require('assert');
 
assert.notOk(Number.isNaN(undefined));
assert.notOk(Number.isNaN(null));
assert.notOk(Number.isNaN(false));
assert.notOk(Number.isNaN(true));
assert.notOk(Number.isNaN(0));
assert.notOk(Number.isNaN(42));
assert.notOk(Number.isNaN(Infinity));
assert.notOk(Number.isNaN(-Infinity));
assert.notOk(Number.isNaN('foo'));
assert.notOk(Number.isNaN(function () {}));
assert.notOk(Number.isNaN([]));
assert.notOk(Number.isNaN({}));
 
assert.ok(Number.isNaN(NaN));

Simply clone the repo, npm install, and run npm test