Arrays (dw::core::Arrays) Flashcards
countBy
Counts the elements in an array that return true when the matching function is applied to the value of each element.
divideBy
Breaks up an array into sub-arrays that contain the specified number of elements.
drop
Drops the first n elements. It returns the original array when n <= 0 and an empty array when n > sizeOf(array).
dropWhile
Drops elements from the array while the condition is met but stops the selection process when it reaches an element that fails to satisfy the condition.
every
Returns true if every element in the array matches the condition.
firstWith
Returns the first element that satisfies the condition, or returns null if no element meets the condition.
indexOf
Returns the index of the first occurrence of an element within the array. If the value is not found, the function returns -1.
indexWhere
Returns the index of the first occurrence of an element that matches a condition within the array. If no element matches the condition, the function returns -1.
join
Joins two arrays of objects by a given ID criteria.
leftJoin
Joins two arrays of objects by a given ID criteria.
outerJoin
Joins two array of objects by a given ID criteria.
partition
Separates the array into the elements that satisfy the condition from those that do not.
slice
Selects the interval of elements that satisfy the condition: from <= indexOf(array) < until
some
Returns true if at least one element in the array matches the specified condition.
splitAt
Splits an array into two at a given position.