Python-like unpacking in JavaScript
Once you ‘ve collected the function arguments in an array, you can use the apply() method of the function object to invoke your predefined function with it: some_javascript_function.apply(this, my_args) The first parameter (this) sets the context of the invoked function.