These collection methods are used to filter or perform a function on each element in the collection. Most of them are analagous to native Array methods.
alias: forEach(fn, [context])
Call the iterator function for each element in the collection and return the collection.
Call the iterator function for each element in the collection. For any elements returned by the iterator function, return them wrapped in a new collection.
Re-order the elements in the collection based on the sort function.
Return an array of values from each element in the collection - e.g. attribute, data or object properties.
Return a new collection of elements that match the filter, which can be a function, CSS selector or elements. Equivalent to Array.filter
Return true
if all elements in the collection match the filter, which can be a function, CSS selector or elements. Otherwise false
.
Return true
if any elements in the collection match the filter, which can be a function, CSS selector or elements. Otherwise false
.
Return the collection index of the first element in the collection that matches the filter, which can be a function, CSS selector or elements. Otherwise -1
.
Return the collection index of the last element in the collection that matches the filter, which can be a function, CSS selector or elements. Otherwise -1
.
Pablo collections are extended Arrays, so all native Array methods should be supported. For example:
Performs a native array reduce()
call on the collection, returning the result. The callback is passed previousValue
, el
, index
and collection
.
As reduce()
, but reduces the collection from right-to-left.