function functor(val){
   return function(){
      return val;
   }
}
Create a function which always returns the same
value

var return3 = functor(3);

return3() // gives 3
return3() // still gives 3
return3() // will always give 3