Open In App

Underscore.js _.compose() Function

Last Updated : 25 Nov, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report
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: Example 2:
Output:

Explore