Parameters: This function accepts a single parameter as mentioned above and described below:
- e : This parameter holds a condition that has to pass by the collection
Return value: Processed value
Below examples illustrate the first() function in collect.js
Example 1: Here in this example, we take a collection and then using the first() function to get first value.
Example 2: In this example, we will get the first negative value.