![]() |
VOOZH | about |
The macro() method is used to register a custom method. This method used the custom function.
Syntax:
collect(array).macro()
Parameters: The collect() method takes one argument that is converted into the collection and then macro() method is applied on it.
Return Value: This method returns the collection keys.
Below example illustrate the macro() method in collect.js:
Example 1:
Output:
Collection {
items: [
true, false, false,
true, true, false,
true, true, false,
true
]
}
Example 2:
Output:
Collection { items: [ 'GFG', 'GEEKS', 'GEEKSFORGEEKS' ] }