Question: Using JavaScript functional programming, you can create functions that create new functions with different properties. Please see the question below. Example: A function that returns

Using JavaScript functional programming, you can create functions that create new functions with different properties. Please see the question below.
Example:
A function that returns a function to test if a number is greater than a given number.
function greaterThan (n){
return function (m){
return m > n;
};
}
To use the above function :
var greaterThan10= greaterThan(10); // is this correct? What is the
purpose of this line?
console.log(greaterThan10(11));
// Output: true
Thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!