main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
440 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var GetIntrinsic = require('get-intrinsic');
|
---|
4 |
|
---|
5 | var $abs = GetIntrinsic('%Math.abs%');
|
---|
6 | var $floor = GetIntrinsic('%Math.floor%');
|
---|
7 |
|
---|
8 | var $isNaN = require('./isNaN');
|
---|
9 | var $isFinite = require('./isFinite');
|
---|
10 |
|
---|
11 | module.exports = function isInteger(argument) {
|
---|
12 | if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
|
---|
13 | return false;
|
---|
14 | }
|
---|
15 | var absValue = $abs(argument);
|
---|
16 | return $floor(absValue) === absValue;
|
---|
17 | };
|
---|
18 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.