Tag Archives: Collect.js

The where() function is used to filter the collection by a given key or value contained within the given array. In JavaScript, the array is… Read More
The whereIn() function is used to filter the collection by a given key or value contained within the given array. In JavaScript, the array is… Read More
Collect.js is a fluent and convenient wrapper for working with arrays and objects. The make() function creates a new collection instance. Installation: Install the Collect.js module… Read More
Collect.js is a fluent and convenient wrapper for working with arrays and objects. The whenEmpty() function executes the callback function when the collection is empty. … Read More
Collect.js is a fluent and convenient wrapper for working with arrays and objects. The whenNotEmpty() function executes the callback function when the collection is not… Read More
Collect.js is a fluent and convenient wrapper for working with arrays and objects. The unlessNotEmpty() function executes the callback function when the collection is empty. … Read More
Collect.js is a fluent and convenient wrapper for working with arrays and objects. The unlessEmpty() function executes the callback function when the collection is not… Read More
Collect.js is a fluent and convenient wrapper for working with arrays and objects. The tap() function accepts the collection as a parameter and without affecting… Read More
The unique() method is used to return the all of the unique values in the collection. Syntax: collect(array).unique() Parameters: The collect() method takes one argument… Read More
The sort() method is used to sort the items of the collection. Syntax: collect(array).sort() Parameters: The collect() method takes one argument that is converted into… Read More
The union() method is used to add the given array to the collection with the unique values. If the given array contains values that are… Read More
The splice() method is used to  remove and returns a slice of items starting at the specified index Syntax: collect(array).splice() Parameters: The collect() method takes… Read More
The sortBy() method is used to sort the collection by the given key. Syntax: collect.sortBy() Parameters: The collect() method takes one argument that is converted… Read More
The times() method is used to create a new collection by invoking the callback a given amount of times. Syntax: collect.times() Parameters: The collect() method… Read More
The sortDesc() method is used to sort the collection in the opposite order as the sort method. Syntax: collect.sortDesc() Parameters: The collect() method takes one… Read More