to-length-x

4.2.2 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.2.2
    44
    • latest

Version History

Package Sidebar

Install

npm i to-length-x

Weekly Downloads

847

Version

4.2.2

License

MIT

Unpacked Size

236 kB

Total Files

11

Last publish

Collaborators

  • xotic750