source: imaps-frontend/node_modules/lodash-es/isNumber.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 884 bytes
RevLine 
[d565449]1import baseGetTag from './_baseGetTag.js';
2import isObjectLike from './isObjectLike.js';
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 are
11 * classified as numbers, use the `_.isFinite` method.
12 *
13 * @static
14 * @memberOf _
15 * @since 0.1.0
16 * @category Lang
17 * @param {*} value The value to check.
18 * @returns {boolean} Returns `true` if `value` is a number, else `false`.
19 * @example
20 *
21 * _.isNumber(3);
22 * // => true
23 *
24 * _.isNumber(Number.MIN_VALUE);
25 * // => true
26 *
27 * _.isNumber(Infinity);
28 * // => true
29 *
30 * _.isNumber('3');
31 * // => false
32 */
33function isNumber(value) {
34 return typeof value == 'number' ||
35 (isObjectLike(value) && baseGetTag(value) == numberTag);
36}
37
38export default isNumber;
Note: See TracBrowser for help on using the repository browser.