← All Modules

Methods

array

average

average(array)

Parameters:

  • array

Returns the average of the array elements.

compact

compact(array, strict)

Parameters:

  • array
  • strict

Returns an array with truthy values.

drop

drop(array, digit)

Parameters:

  • array
  • digit

Removes elements of the array.

identifier

identifier(array)

Parameters:

  • array

Returns a new unique identifier based on passed in identifiers.

median

median(array)

Parameters:

  • array

Returns the median of the array elements.

pluck

pluck(array)

Parameters:

  • array

Returns a list of property values from an array of objects.

rotate

rotate(array, digit)

Parameters:

  • array
  • digit

Rotates the elements on the array. When second parameter is negative, shifting starts from the end of the array.

sample

sample()

Returns random element of the array.

slice

slice(array, start, end)

Parameters:

  • array
  • start
  • end

Extracts a fragment of the array.

sum

sum(array)

Parameters:

  • array

Returns the sum of the array elements.

take

take(array, digit)

Parameters:

  • array
  • digit

Takes elements from the array based on the second parameter, starting from the beginning of the array.

unique

unique(array, iteratee)

Parameters:

  • array
  • iteratee

Returns an array with unique elements.

first

first(array)

Parameters:

  • array

Returns the first element of the array.

second

second(array)

Parameters:

  • array

Returns the second element of the array.

third

third(array)

Parameters:

  • array

Returns the third element of the array.

fourth

fourth(array)

Parameters:

  • array

Returns the fourth element of the array.

fifth

fifth(array)

Parameters:

  • array

Returns the fifth element of the array.

sixth

sixth(array)

Parameters:

  • array

Returns the sixth element of the array.

seventh

seventh(array)

Parameters:

  • array

Returns the seventh element of the array.

eigth

eigth(array)

Parameters:

  • array

Returns the eigth element of the array.

ninth

ninth(array)

Parameters:

  • array

Returns the ninth element of the array.

tenth

tenth(array)

Parameters:

  • array

Returns the tenth element of the array.

last

last(array)

Parameters:

  • array

Returns the last element of the array.

nth

nth(array, position)

Parameters:

  • array
  • position

Returns the element located at the passed position. When position is negative it searches from the end of the array.

intersection

intersection(arrays)

Parameters:

  • arrays

Returns an array containing elements common to all arrays that have been passed to the function.

difference

difference(array, arrays)

Parameters:

  • array
  • arrays

Returns an array containing elements that do not occur in other arrays.

duplicates

duplicates(array)

Parameters:

  • array

Returns an array containing repeated elements.

symdifference

symdifference(arrays)

Parameters:

  • arrays

Returns an array of elements that are not part of intersection.

comma

comma(array, number)

Parameters:

  • array
  • number

Returns a string created by joining array elements with comma and optional spaces.

union

union(arrays)

Parameters:

  • arrays

Returns an array of unique values.

partition

partition(array, predicate)

Parameters:

  • array
  • predicate

Returns an array of elements split into two groups, the first of which contains elements predicate returns truthy for, the second of which contains elements predicate returns falsey for. The predicate has one argument.

range

range(number, number)

Parameters:

  • number
  • number

Returns an array of numbers within the range.