mirror of
https://github.com/biobulkbende/biobulkbende.org.git
synced 2024-11-05 16:48:43 +00:00
18 lines
454 B
JavaScript
18 lines
454 B
JavaScript
|
'use strict';
|
||
|
|
||
|
var abs = require('./abs');
|
||
|
var floor = require('./floor');
|
||
|
|
||
|
var $isNaN = require('../helpers/isNaN');
|
||
|
var $isFinite = require('../helpers/isFinite');
|
||
|
|
||
|
// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger
|
||
|
|
||
|
module.exports = function IsInteger(argument) {
|
||
|
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
|
||
|
return false;
|
||
|
}
|
||
|
var absValue = abs(argument);
|
||
|
return floor(absValue) === absValue;
|
||
|
};
|