solve functional javascript 17: currying