Projekt

Obecné

Profil

Stáhnout (669 Bajtů) Statistiky
| Větev: | Revize:
1
var toInteger = require('./toInteger');
2

    
3
/**
4
 * Checks if `value` is an integer.
5
 *
6
 * **Note:** This method is based on
7
 * [`Number.isInteger`](https://mdn.io/Number/isInteger).
8
 *
9
 * @static
10
 * @memberOf _
11
 * @since 4.0.0
12
 * @category Lang
13
 * @param {*} value The value to check.
14
 * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
15
 * @example
16
 *
17
 * _.isInteger(3);
18
 * // => true
19
 *
20
 * _.isInteger(Number.MIN_VALUE);
21
 * // => false
22
 *
23
 * _.isInteger(Infinity);
24
 * // => false
25
 *
26
 * _.isInteger('3');
27
 * // => false
28
 */
29
function isInteger(value) {
30
  return typeof value == 'number' && value == toInteger(value);
31
}
32

    
33
module.exports = isInteger;
(369-369/571)