debian-mirror-gitlab/core-js/internals/is-integer.js
2019-09-25 13:30:05 +05:30

9 lines
281 B
JavaScript

var isObject = require('../internals/is-object');
var floor = Math.floor;
// `Number.isInteger` method implementation
// https://tc39.github.io/ecma262/#sec-number.isinteger
module.exports = function isInteger(it) {
return !isObject(it) && isFinite(it) && floor(it) === it;
};