UNPKG

validate.io-nan-primitive

Version:
46 lines (40 loc) 610 B
/** * * 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;