Skip to main content
Module

x/lodash_es/mod.ts>toLength

lodash for deno use
Latest
function toLength
import { toLength } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

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

Note: This method is based on ToLength.

Examples

_.toLength(3.2); // => 3

_.toLength(Number.MIN_VALUE); // => 0

_.toLength(Infinity); // => 4294967295

_.toLength('3.2'); // => 3

Parameters

value

The value to convert.