A JavaScript utility for creating variadic functions