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]: Point) => ({ x, y }))(point));
Sample output
{ x: 3, y: 4 }
Open this example in the interactive library
type Point = readonly [x: number, y: number];
const point: Point = [3, 4];
console.log((([x, y]: Point) => ({ x, y }))(point));
{ x: 3, y: 4 }