您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

22 行
514 B

  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var $Math = GetIntrinsic('%Math%');
  4. var $floor = $Math.floor;
  5. var $abs = $Math.abs;
  6. var $isNaN = require('../helpers/isNaN');
  7. var $isFinite = require('../helpers/isFinite');
  8. // https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger
  9. module.exports = function IsInteger(argument) {
  10. if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
  11. return false;
  12. }
  13. var abs = $abs(argument);
  14. return $floor(abs) === abs;
  15. };