source: imaps-frontend/node_modules/es-abstract/2017/ToLength.js

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: 332 bytes
RevLine 
[d565449]1'use strict';
2
3var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
4
5var ToInteger = require('./ToInteger');
6
7module.exports = function ToLength(argument) {
8 var len = ToInteger(argument);
9 if (len <= 0) { return 0; } // includes converting -0 to +0
10 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
11 return len;
12};
Note: See TracBrowser for help on using the repository browser.