is-nan-x
ES6-compliant shim for Number.isNaN - the global isNaN returns false positives.
Version: 1.0.3
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
module.exports(value)
⇒ boolean
⏏
This method determines whether the passed value is NaN and its type is
Number
. It is a more robust version of the original, global isNaN().
Kind: Exported function
Returns: boolean
- true
if the given value is NaN and its type is Number;
otherwise, false
.
Param | Type | Description |
---|
value | * | The value to be tested for NaN. |
Example
var numberIsNaN = require('is-nan-x');
numberIsNaN(NaN);
numberIsNaN(Number.NaN);
numberIsNaN(0 / 0);
numberIsNaN('NaN');
numberIsNaN(undefined);
numberIsNaN({});
numberIsNaN('blabla');
numberIsNaN(true);
numberIsNaN(null);
numberIsNaN(37);
numberIsNaN('37');
numberIsNaN('37.37');
numberIsNaN('');
numberIsNaN(' ');