npm.io
4.2.2 • Published 6 years ago

to-length-x

Licence
MIT
Version
4.2.2
Deps
1
Size
230 kB
Vulns
0
Weekly
0
Stars
1

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

to-length-x

Shim for ToLength.

See: 7.1.15 ToLength ( argument )

module.exports(value)*

to-length-x*

Converts value to an integer suitable for use as the length of an array-like object. (ES2019)

Kind: static property of to-length-x
Returns: number - Returns the converted integer.

Param Type Description
value * The value to convert.

Example

var toLength = require('to-length-x').toLength2018;
toLength(3); // 3
toLength(Number.MIN_VALUE); // 0
toLength(Infinity); // Number.MAX_SAFE_INTEGER
toLength('3'); // 3

Keywords