main
Last change
on this file since e48199a was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
350 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var trunc = require('../internals/math-trunc');
|
---|
3 |
|
---|
4 | // `ToIntegerOrInfinity` abstract operation
|
---|
5 | // https://tc39.es/ecma262/#sec-tointegerorinfinity
|
---|
6 | module.exports = function (argument) {
|
---|
7 | var number = +argument;
|
---|
8 | // eslint-disable-next-line no-self-compare -- NaN check
|
---|
9 | return number !== number || number === 0 ? 0 : trunc(number);
|
---|
10 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.