Open this example in the interactive library
Source code
type Point = readonly [x: number, y: number];
const point: Point = [3, 4];
console.log((([x, y, z = 0]: [number, number, number?]) => x + y + z)([1, 2]));
Sample output
3

Open this example in the interactive library
type Point = readonly [x: number, y: number];
const point: Point = [3, 4];
console.log((([x, y, z = 0]: [number, number, number?]) => x + y + z)([1, 2]));
3