The all() method is used to return the underlying array or object represented by the collection.
|
The average() method is used to return the average of all the items in a collection
|
The avg() method returns the average of all the items in a collection.
|
The chunk() function breaks the collection into many small collections of the given size
|
The Collapse() method converts a collection of arrays into a single flat array.
|
The Combine() Method combines two different arrays with keys-values. The first array contains keys combined with the second array Which contains values.
|
The concat() method is used to return the merged arrays or objects represented by the collection.
|
The contains() method is used to determine whether the collection contains a given item or not.
|
The count() Method is used to count the number of collections in the element.
|
The countBy() Method is used to count the occurrence of values in the collection. This method counts the occurrence of every element.
|
The crossJoin() Method used to cross joins the collection with an array or collection and return all possible permutations between them.
|
The dd() Method in collect.js is used to log the output of the function and stop the further execution thus exiting the current process.
|
The diff() Method compares the main collection against the given collection and returns the values which are in original collection but not in the given collection.
|
The diffAssoc() Method is used to compare two given collection and returns the values and their indices which are not present in the given collection.
|
The diffKeys() Method converts the array into collections and then compares the collection against another collection based on its keys and returns elements in the original collection that are not present in another collection.
|
The dump() Method in collect.js is used to print the data at particular moment and then continue further executing the code.
|
The duplicates() Method is used to extract the duplicates from the given array. It returns an object containing key as the index of the duplicate and value as the duplicate itself.
|
The each() Method iterates over the items in the collection and passes each item to a callback.
|
The eachSpread() Method is used to iterate over the collection items and pass each nested item value of collection into the given callback function
|
The every() Method is used to verify all elements of the given collection and use a given truth test.
|
The except() Method is used to return all items in the given collection except the specified keys
|
The filter() Method is used to filter the given collection using the given callback function and returns the collection element.
|
Simply means it returns the first value or the first method returns the first element in the collection that passes a given condition.
|
The firstWhere() method is used to return the first element from a collection with the given key and value pair. It can be used to find any element in an array by only specifying any of the key-value pairs in an object.
|
The flatMap() method is used to iterate all the collection elements and pass each collection elements into given callback.
|
The flatten() method is used to flatten a multi-dimensional collection into a single dimensional collection and returns the flatten single dimensional collection elements.
|
The flip() Method swaps the key with its corresponding value.
|
The forPage() Method is used to return the value which is present at a particular page, this function take the page number as an argument and then returns the collection.
|
The forget() Method as the name suggest forgets/remove an item from the collection using its key.
|
The get() Method is used to return a value that is present at a particular key.
|
The groupBy() method is used to group the given collection items into multiple collections by a given key
|
The has() method in Collect.js is used to check whether the key exists in the collection or not.
|
The implode() method is used to join the given items into the collection.
|
The intersect() function is used to remove the value in the main collection which is not present
|
The intersectByKeys() method is used to remove any given keys from the original collection that are not present in the given array or collection
|
The isEmpty() method is used to check the given collection is empty or not and returns the corresponding boolean value.
|
The isNotEmpty() method is used to check the given collection is not empty or empty and returns the corresponding boolean value.
|
The join() method is used to join the collection elements with given string and returns the collection elements.
|
The keyBy() method is used to keys the collection elements by the given key. If the collection contains multiple items with same key then the last element will appear.
|
The keys() method is used to return all of the collection’s keys.
|
The last() method is used to return the last element from the collection that satisfy the given truth test.
|
The macro() method is used to register a custom method. This method used the custom function.
|
Collect.js is a fluent and convenient wrapper for working with arrays and objects. The make() function creates a new collection instance.
|
The map() function iterates through a collection and pass each value to callback.
|
The mapInto() method is used to iterate through the collection elements and instantiate the given class with each element as a constructor.
|
The mapSpread() method is used to iterate over the given collection items and pass each nested collection item value into the given callback.
|
The mapToDictionary() method is used to run a dictionary map over the collection items.
|
The mapToGroups() method is used to iterate through the collection elements and passes each value of collection into the given callback function.
|
The mapWithKeys() method is used to iterate through the collection elements and passes each collection element into the given callback function.
|
The max() method is used to return the maximum value of a given key.
|
The median() method is used to return the median of the collection elements or median of the given key from the collection.
|
The merge() method is used to merge the given object into the original collection.
|
The mergeRecursive() method is used to merge the given array or collection elements recursively with the original collection.
|
The min() method is used to return the minimum element from the given array or collection.
|
The mode() method of collect.js is used to return the mode of the given key.
|
The nth() method is used to create a new collection consisting of every n-th element.
|
The only() method is used to return the items from the given collection with the specified keys.
|
The pad() method is used to fill the array with the given element until the size of the array is full.
|
The partition() method is used to separate the collection elements according to the given callback function.
|
The pipe() method is used to hold a callback function and apply this function into the collection and returns the corresponding result.
|
The pluck() method is used to return all the values from the given key.
|
The pop() method is used to remove the last element from collection and returns the popped element.
|
The prepend() method is used to add an item at the beginning of the given collection.
|
The pull() method is used to remove an element from collection by given key and return the pulled element.
|
The push() function is used to add a new value to the end of the collection. In JavaScript, the array is first converted to a collection and then the function is applied to the collection
|
The put() method is used to set the given key and value in the collection.
|
The random() function as the name suggest it returns any random value from the collection.
|
The reduce() method is used to reduce the collection elements into a single value according to the given callback.
|
The reject() method is used to filter the given collection of elements using the given callback function.
|
The replace() method is used to replace the elements of the original collection that match the given string or numeric keys.
|
The replaceRecursive() method is similar to the replace() method but it works recursively and this method will recurse into arrays and the inner values are treated with the same replacement process.
|
The reverse() method is used to reverse the order of the given collection. It can be used to reverse an array of elements or nested objects.
|
The search() method is used to search the given element in collection and returns its key if it exists. If the element is not found then it returns false.
|
The shift() method is used to remove the first element from collection and returns it.
|
The shuffle() method is used to return the collection elements randomly.
|
The skip() method is used to skip the given number of elements from collection and returns the remaining collection elements.
|
The skipUntil() method is used to skip the collection elements until the given callback returns true and then returns the remaining items in the collection:
|
The skipWhile() method is used to skip the collection elements while the given callback function returns true and returns the remaining collection elements.
|
The slice() method is used to return a slice of the given collection starting at given index.
|
The some() method is used to check whether the given collection contains a given item or not and returns the corresponding boolean value.
|
The sort() method is used to sort the items of the collection.
|
The sortBy() method is used to sort the collection by the given key.
|
The sortByDesc() method is used to sort the given collection elements into descending order according to given key.
|
The sortDesc() method is used to sort the collection in the opposite order as the sort method.
|
The sortKeys() method is used to sort the collection elements by the given keys of the underlying associative array.
|
The sortKeysDesc() method is used to sort the collection elements in descending order by the given keys of the underlying associative array.
|
The splice() method is used to remove and returns a slice of items starting at the specified index
|
The split() method in collect.js is used to break a collection into the given number of groups.
|
The sum() method in collect.js is used to return the sum of all the items in the given collection.
|
The take() method is used to return a new collection with the specified number of items.
|
The takeUntil() method is used to return the items in the collection until the given callback returns true.
|
The takeWhile() method is used to return the items in the collection until the given callback returns false.
|
The tap() Method accepts the collection as a parameter and without affecting the collection it allows the user to tap into the collection at a specific point and do anything with the item.
|
The times() method is used to create a new collection by invoking the callback a given amount of times.
|
The toArray() method is used to convert the given collection into a normal array. An array containing the values will be returned if the collection is an object.
|
The toJson() method is used to convert the collection into a JSON string.
|
The transform() Method iterates over a collection and callback each item in the collection, the items inside the collection are replaced by the new callback values.
|
The union() method is used to add the given array to the collection with the unique values.
|
The unique() method is used to return the all of the unique values in the collection.
|
The unless() method is executes the callback provided when false is evaluated by the first argument given to the method.
|
The unlessEmpty() Method executes the callback function when the collection is not empty.
|
The unlessNotEmpty() Method executes the callback function when the collection is empty.
|
The unwrap() method is used to unwrap the given collection.
|
The values() method is used to return a new collection with the given keys reset to consecutive integers.
|
The when() method is used to execute the given callback when the first argument given to the method evaluates to true.
|
The whenEmpty() Method executes the callback function when the collection is empty.
|
The whenNotEmpty() Method executes the callback function when the collection is not empty.
|
The where() Method is used to filter the collection by a given key or value contained within the given array.
|
The whereBetween() Method is used to filter an input within a given range. In JavaScript, the array is first converted to a collection and then the function is applied to the collection.
|
The whereIn() function is used to filter the collection by a given key or value contained within the given array.
|
The whereInstanceOf() Method is used to filter input with a given class type. In JavaScript, the array is first converted to a collection and then the function is applied to the collection.
|
The whereNotBetween() Method is used to filter an input which do not lie in a specified range.
|
The whereNotIn() method in collect.js is used to filter the elements from the given collection on the basis of key and value. If particular set of key-value is found then it is filtered out.
|
The whereNotNull() method is used to return a collection that does not contain any null values. In simple words, it filters the values that are not null.
|
The whereNull() method in collect.js is used to filter the values from a collection that is null.
|
The wrap() method in collect.js is used to wrap a particular set of values in a collection.
|
The zip() function is used to combine the values of given array with the values of original collection at a given index
|