COLLECTED BY
Organization:
Internet Archive
Focused crawls are collections of frequently-updated webcrawl data from narrow (as opposed to broad or wide) web crawls, often focused on a single domain or subdomain.
The Wayback Machine - https://web.archive.org/web/20201220221502/https://github.com/lodash/lodash/blob/master/isNumber.js
Permalink
Cannot retrieve contributors at this time
34 lines (32 sloc)
812 Bytes
import getTag from './.internal/getTag.js'
import isObjectLike from './isObjectLike.js'
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `Number.isFinite` method.
*
* @since 0.1.0
* @category Lang
* @param {* } value The value to check.
* @returns {boolean } Returns `true` if `value` is a number, else `false`.
* @see isInteger, toInteger, toNumber
* @example
*
* isNumber(3)
* // => true
*
* isNumber(Number.MIN_VALUE)
* // => true
*
* isNumber(Infinity)
* // => true
*
* isNumber('3')
* // => false
*/
function isNumber ( value ) {
return typeof value === 'number' ||
( isObjectLike ( value ) && getTag ( value ) == '[object Number]' )
}
export default isNumber
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.