Higher-order functions are functions that take other functions as arguments or return functions as their results.
The functions which is pass as an argument is known as call back function.
Here, filterOdd function is a Higher order function as it is accepting isOdd function as an argument and also returning finalArray.
isOdd is a call back function as it is passed as an argument in filterOdd function
Without Higher-order function
With Higher-order function(Map)
with use of higher order function we can write short and accurate code where chances of getting error is very less
Similarly, some methods of string and array i.e reduce, filter, some, map use call back function to compute output