• Gets the size of collection by returning its length for array-like values or the number of own enumerable properties for objects.

    Parameters

    • collection:
          | undefined
          | null
          | string
          | object

      The collection to inspect.

    Returns number

    Returns the size of collection.