Why functional programming matters
Functional programming is different from imperative programming languages in one big way: they have first-class functions. Functions can be passed as arguments to functions, assigned to variables, and returned from other functions. You can also have anonymous functions which don’t even have names.
Given a language with first-class functions you can easily implement abstractions that really save you time and make your code more maintainable.
Case 1: Applying an operation to every element of a collection
Case 2: Searching for the first element that matches a condition
Case 3: Combining the elements of a collection in a single value.
Case 4: Traversing through a collection and applying an operation to each element.
Case 5: Filtering a collection based on some predicate.