Skip to main content

Ivan Teoh

Something personal yet public

166-homework2.js

(Source)

function greaterThan(number1) {
    function test(number2) {
        return number2 > number1;
    }
    return test;
}

var greaterThanTwenty = greaterThan(20);
alert(greaterThanTwenty(52));
alert(greaterThanTwenty(10));