Options
All
  • Public
  • Public/Protected
  • All
Menu

Module toLength

Index

References

Functions Lang

References

Renames and re-exports toLength

Lang Functions

  • toLength(value: number): number
  • toLength(value: string): number
  • Converts value to an integer suitable for use as the length of an array-like object.

    Note: This method is based on ToLength.

    since

    5.13.0

    example
    toLength(3.2)
    // => 3

    toLength(Number.MIN_VALUE)
    // => 0

    toLength(Infinity)
    // => 4294967295

    toLength('3.2')
    // => 3

    Parameters

    • value: number

      The value to convert.

    Returns number

    Returns the converted integer.

  • Parameters

    • value: string

    Returns number