Here's the example code I'm struggling with:
function greaterThan(x) {
return function(y) {
return y > x;
};
}
var greaterThanTen = greaterThan(10);
show(greaterThanTen(9));
Is there a way to put it in math terms or follow the flow or something? I don't know why 10 is x and 9 is y.
In the line:
You are assinging the variable x to the value 10 and then you store the function in the greaterThanTen Variable to be called later. this means that:
So when you do:
You are calling: