/
githubmirror
/
lodash
Обзор
Документация
Войти
/
githubmirror
/
lodash
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.18.0-amd
isInteger.js
34 строки
729 B
John-David Dalton
Bump to v4.7.0.
31 мар 2016, 10:33
31 мар 2016, 10:33
d46bcaa
Код
Авторство
О чём код?
define(['./toInteger'], function(toInteger) { /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } return isInteger; });