Collection

Collection

new Collection()

Description:
  • An extended Map with utility methods.

Source:

Methods

find(propOrFunc, valueopt) → {any|null}

Description:
  • Finds first matching value by property or function. Same as Array#find.

Source:
Parameters:
Name Type Attributes Description
propOrFunc string | function

Property or function to test.

value any <optional>

Value to find.

Returns:
  • The found item or null if none found.
Type
any | null

filter(func, thisArgopt) → {Collection}

Description:
  • Filters cache by function. Same as Array#filter.

Source:
Parameters:
Name Type Attributes Description
func function

Function to test.

thisArg any <optional>

The context for the function.

Returns:
  • A new collection with the filtered items.
Type
Collection

map(func, thisArgopt) → {Array.<any>}

Description:
  • Maps cache by function. Same as Array#map.

Source:
Parameters:
Name Type Attributes Description
func function

Function to use.

thisArg any <optional>

The context for the function.

Returns:
  • An array with the mapped items.
Type
Array.<any>