1 |
Foreach takes a callback function and run that callback function on each element of array one by one. |
The main difference between forEach and filter is that forEach just loop over the array and executes the callback but filter executes the callback and check its return value. |
Map like filter & foreach takes a callback and run it against every element on the array but whats makes it unique is it generate a new array based on your existing array. |
Function .find() is also a search function like the previous but they differ in one small detail — this function returns only one match in an array. If in an array is more than one result, the function will return the first that has matched. |