I\'d like to call a function using an array as parameters:
const x = [\'p0\', \'p1\', \'p2\'];
call_me(x[0], x[1], x[2]); // I don\'t like it
function call_
you can use spread operator in a more basic form
[].concat(...array)
in the case of functions that return arrays but are expected to pass as arguments
Example:
function expectArguments(...args){
return [].concat(...args);
}
JSON.stringify(expectArguments(1,2,3)) === JSON.stringify(expectArguments([1,2,3]))