function flip(fn){
   return function(a, b){
      return fn(b,a);
   }
}
Swap the order of parameters to a binary function

A bit like this flip: http://zvon.org/other/haskell/Outputprelude/flip_f.html