source: trip-planner-front/node_modules/core-js/internals/to-index.js@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 393 bytes
Line 
1var toInteger = require('../internals/to-integer');
2var toLength = require('../internals/to-length');
3
4// `ToIndex` abstract operation
5// https://tc39.es/ecma262/#sec-toindex
6module.exports = function (it) {
7 if (it === undefined) return 0;
8 var number = toInteger(it);
9 var length = toLength(number);
10 if (number !== length) throw RangeError('Wrong length or index');
11 return length;
12};
Note: See TracBrowser for help on using the repository browser.