main
Last change
on this file since d565449 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
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
---|
4 |
|
---|
5 | var ToInteger = require('./ToInteger');
|
---|
6 |
|
---|
7 | module.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.