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.
- Difference between :first-child and :first-of-type selector in CSS
- How to merge the first index of an array with the first index of second array?
- PHP | Ds\Sequence first() Function
- PHP | Ds\Vector first() Function
- PHP | Ds\Deque first() Function
- PHP | Ds\Set first() Function
- Flask - (Creating first simple application)
- jQuery | first() with Examples
- Underscore.js | first() with Examples
- Determine the first and last iteration in a foreach loop in PHP?
- How to use a not:first-child selector in CSS?
- CSS | :first-child Selector
- Getting started with React Native? Read this first !
- Introduction to HTML CSS | Learn to Design your First Website in Just 1 Week
- HTML Course | First Web Page | Printing Hello World
- CSS | :first-of-type Selector
- CSS | ::first-letter Selector
- CSS | ::first-line Selector
- Step by step guide to make your first Wordpress Plugin
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : akhilsharma870