Open Source Your Knowledge, Become a Contributor

Higher Order Function

In functional programming, a function is defined as a "first order citizen".
This means it includes all the properties generally available to any other element, such as the possibility of being affected to a name, returned as a result or passed as a parameter.

A higher-order function is a function that accepts other functions as parameters and/or use a function as the return value.
Let's try it out!
Implement the greeting function to return "Hello, [name]" if the name is defined. Otherwise, return "who are you?".