validate.io-nan-primitive
Version:
Validates if a value is a NaN primitive.
46 lines (40 loc) • 610 B
JavaScript
/**
*
* VALIDATE: nan-primitive
*
*
* DESCRIPTION:
* - Validates if a value is a NaN primitive.
*
*
* NOTES:
* [1]
*
*
* TODO:
* [1]
*
*
* LICENSE:
* MIT
*
* Copyright (c) 2015. Athan Reines.
*
*
* AUTHOR:
* Athan Reines. kgryte@gmail.com. 2015.
*
*/
'use strict';
/**
* FUNCTION: nan( value )
* Validates if a value is a NaN primitive.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether the value is a NaN primitive
*/
function nan( value ) {
return typeof value === 'number' && value !== value;
} // end FUNCTION nan()
// EXPORTS //
module.exports = nan;