function foo(...x: number[]) { console.log(JSON.stringify(x)); } var args:number[] = [0, 1, 2]; foo(...args);