Create JavaScript - Function Optimization & Currying