Collect.js toArray() Method
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.
Parameters: The collect() method takes one argument that is converted into the collection and the toArray() method is applied to it.
Return Value: This method returns an array of the given collection.
Below example illustrate the toArray() method in collect.js:
["kripa", "biltu", "chinu", 1, 2, 3]
[ 'TATA', [ 'tcs', 'tata motors', 'tata tea', 'tata salt', 'sonata' ] ]