to-length-x
Shim for ToLength.
See: 7.1.15 ToLength ( argument )
Version: 3.0.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
to-length-x.toLength
Reference to toLength2018.
Kind: static property of to-length-x
to-length-x.toLength2016
⇒ number
Converts value
to an integer suitable for use as the length of an
array-like object. (ES2016)
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').toLength2016;
toLength(3);
toLength(Number.MIN_VALUE);
toLength(Infinity);
toLength('3');
to-length-x.toLength2018
⇒ number
Converts value
to an integer suitable for use as the length of an
array-like object. (ES2018)
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);
toLength(Number.MIN_VALUE);
toLength(Infinity);
toLength('3');