Options
All
  • Public
  • Public/Protected
  • All
Menu

Module size

Index

References

Functions Collection

References

Renames and re-exports __type

Collection Functions

  • size(collection: string): number
  • size(collection: ArrayLike<any>): number
  • size(collection: Record<string, any>): number
  • size(collection: any): number
  • Gets the size of collection by returning its length for array-like values or the number of own enumerable string keyed properties for objects.

    since

    5.7.0

    example
    size([1, 2, 3])
    // => 3

    size({ 'a': 1, 'b': 2 })
    // => 2

    size('pebbles')
    // => 7

    Parameters

    • collection: string

      The collection to inspect.

    Returns number

    Returns the collection size.

  • Parameters

    • collection: ArrayLike<any>

    Returns number

  • Parameters

    • collection: Record<string, any>

    Returns number

  • Parameters

    • collection: any

    Returns number