Update JavaScript - Function Optimization & Currying