All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.internals.to-length.js Maven / Gradle / Ivy

There is a newer version: 3.39.0
Show newest version
'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');

var min = Math.min;

// `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
module.exports = function (argument) {
  return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy