IsIntegralNumber.js 348 B

1234567891011121314
  1. 'use strict';
  2. var truncate = require('./truncate');
  3. var $isFinite = require('../helpers/isFinite');
  4. // https://262.ecma-international.org/14.0/#sec-isintegralnumber
  5. module.exports = function IsIntegralNumber(argument) {
  6. if (typeof argument !== 'number' || !$isFinite(argument)) {
  7. return false;
  8. }
  9. return truncate(argument) === argument;
  10. };