The
_.compose() function is used to return the composition of the list of functions. The list of the function returns the value of the function that follows.
Syntax:
_.compose(*functions)
Parameters: This function accept a single parameter as mentioned above and described below:
- functions: It contains the list of function that to be executed.
Return Value: It returns the composition of list of functions.
Below examples illustrate the
_.compose() function in Underscore.js:
Example 1:
Output:
👁 Image
Example 2: