Tuple as Coordinates
Tuples represent fixed-length arrays with known element types. Aliasing a tuple clarifies intent (e.g., a coordinate). Return a new tuple instead of reusing the argument.
- Use a tuple alias for coordinates.
- Keep calculations simple and avoid mutating inputs.
- Return the translated coordinate.
Your Task
- Define type Coord = [number, number].
- Implement translate(c: Coord, dx: number, dy: number): Coord returning a new coordinate [c[0] + dx, c[1] + dy].