The output for the above code is
JAVASCRIPT
1First argument is an array: John,Tina,Kale,Max
2Argument passed to second Function is a string.
3First argument is an array: John,Tina,Kale,Max
4Argument passed to second Function is a string.
The returnFunction()
function in the preceding code is a higher-order function since it outputs the function secondFunction()
, which requires an additional parameter y
.