Function Currying in JavaScript