Implement a Variable-Arity Curry Utility — Easy JavaScript/TypeScript Practice Problem