Open this example in the interactive library
Source code
type Point = readonly [x: number, y: number];
const point: Point = [3, 4];
console.log(
(([head, ...tail]: [number, ...number[]]) => Math.max(head, ...tail))([
2, 9, 1,
]),
);
Sample output
9
