main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
410 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $abs = require('./abs');
|
---|
4 | var $floor = require('./floor');
|
---|
5 |
|
---|
6 | var $isNaN = require('./isNaN');
|
---|
7 | var $isFinite = require('./isFinite');
|
---|
8 |
|
---|
9 | /** @type {import('./isInteger')} */
|
---|
10 | module.exports = function isInteger(argument) {
|
---|
11 | if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
|
---|
12 | return false;
|
---|
13 | }
|
---|
14 | var absValue = $abs(argument);
|
---|
15 | return $floor(absValue) === absValue;
|
---|
16 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.