3 ms·
That’s a fair point. In my opinion, more languages should support something like TypeScript’s labeled tuple elements[1] for use cases like that. 1: I wasn’t ab
by eyelidlessness 5y ago
That’s a fair point. In my opinion, more languages should support something like TypeScript’s labeled tuple elements[1] for use cases like that.
1: I wasn’t able to find this in the main docs for some reason? Only the release notes. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements https://www.typescriptlang.org/docs/handbook/release-notes/t...
- WorldMaker 5y agoYeah, it's a API communication issue that tools like Typescript are designed to solve with "type information". Typescript's labeled tuples are a relatively recent addition, but an extremely welcome one especially here in this specific [lat, lon] versus [lon, lat] communication problem.
- eyelidlessness 5y agoIt’s also super handy for preserving parameter names when dealing with rest/spread in both runtime and static type positions, and even for naming new ones in static types for composition.