lodash Working with Lists and Arrays

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • _.map(collection, Function) => newCollection
  • _.filter(collection, Predicate) => newCollection
  • _.some(collection, Predicate) => true or false
  • _.reduce(collection, BiFunction, seed) => accumulated value

Parameters

ParameterMeaning
CollectionAn iterable group of elements. This can be an array or an object.
FunctionA function that takes 1 input, and returns one output.
BiFunctionA function that takes 2 inputs, and returns one output.
PredicateA function that takes 1 input, and returns a boolean value.
seedThe initial value for a reduction operation. When this is left out, the first element of the collection is used instead.


Got any lodash Question?