Pages

Closure : one more


me = {
   name : "denis",
   age : 50
}

you = {
   name : "anonymous",
   age : 45
}


function greaterThan(n) {
  return function(m) { return m > n; };
}
var greaterThanMe = greaterThan(me.age);
console.log(greaterThanMe(you.age));