typescript spread operator code example
Example 1: spread operator in ts
function foo(...x: number[]) {
console.log(JSON.stringify(x));
}
var args:number[] = [0, 1, 2];
foo(...args);
Example 2: javascript spread operator
function myFunction(v, w, x, y, z) { }
let args = [0, 1];
myFunction(-1, ...args, 2, ...[3]);