Partial Application with JavaScript