typescript spread operate to access array by index 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: es6 spread
const numbers = [43, 3, 11, 54];
const max = Math.max(...numbers); // Spreads numbers as parameters
// max is 54