How does this “higher-order functions” thing works in Javascript
问题 From the book Eloquent Javascript by Marijn Haverbeke, there is this example while introducing the concept of higher-order functions: function greaterThan(n) { return function(m) { return m > n; }; } var greaterThan10 = greaterThan(10); console.log(greaterThan10(11)); // → true I'm not quite sure how this works... probably answering my own question, but this is how I see it: First, greaterThan(n) is called in this line, assigning its value to the greaterThan10 variable: var greaterThan10 =