CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
isNumber.js39 linesDownload Raw Back to lodash
1var baseGetTag = require('./_baseGetTag'),2    isObjectLike = require('./isObjectLike');3 4/** `Object#toString` result references. */5var numberTag = '[object Number]';6 7/**8 * Checks if `value` is classified as a `Number` primitive or object.9 *10 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are11 * classified as numbers, use the `_.isFinite` method.12 *13 * @static14 * @memberOf _15 * @since 0.1.016 * @category Lang17 * @param {*} value The value to check.18 * @returns {boolean} Returns `true` if `value` is a number, else `false`.19 * @example20 *21 * _.isNumber(3);22 * // => true23 *24 * _.isNumber(Number.MIN_VALUE);25 * // => true26 *27 * _.isNumber(Infinity);28 * // => true29 *30 * _.isNumber('3');31 * // => false32 */33function isNumber(value) {34  return typeof value == 'number' ||35    (isObjectLike(value) && baseGetTag(value) == numberTag);36}37 38module.exports = isNumber;39 
basant307/AI_Governance_Project · CoolFace