▲ Implementing Tuples in JavaScript - Mastering JS at masteringjs.io▼5 up and 0 down, posted by vkarpov15 639 days ago 1 comment
mmcmahon 638 days ago. link 1 point ▲ ▼Love the series. I would mention the `readonly` and `as const` expressions for TypeScript tuples. `readonly` is necessary to make tuples immutable in TypeScript. `as const` allows you to easily create immutable tuples without repeating yourself. Example in playground: https://www.typescriptlang.org/play?#code/FAb2AJwMwVwOwMYBcCWB7O4DmBTJBhNNAJwBMU4BDJHAZwAoBKALnGJ0tIwBsBPcANpwYAWwBGOYgBpww8ZJlyJxALrgwkSAgy0k4AB7gAvOACMAbgibtcXeH4mATJc3gbdgF7HwAZktXIdiQYYkwBfRleGQ8VF3AAX2Ardz0ABzQKPRNcAiIyCmo6JiTIAHpS8HxKODg0PUpaWhQsTCQ0cAByAAYO8AkEShhaHHAUPRRacEo2DlIAWh5+VOI0VMkkXgA6ekcAVgAWLsYrdMyBLrUTAE4S8HLwABUYVO4RjbXO9k5FwSUFWVEykUgMkKl6aCg4FecCwSAAFp0fL04Q1ZO0cK8RDg4PVxnBSDhDB0kZtkjo9AIAO4yCL2aKXbB4QgkchUGgMRj+RKgKz3ACqTRh4AABqiUsLwBhwPCRkEQpgAG6UbgwEZUYgrSmTGXS9rTd4jbhjSTK2hWWCIVBSnLM-JsoqMdQBNzkgzeCzOlL2bzOT2urwmPy3QJ4eWCWlRcAxKaTFJxRKQMm2NIZHHeG15VmFDl3CoUKCSdikaW8NasL5cOB8QSmGSOGQ+FS3U4484Mq6uTtd7td+6AXg3ALI74F0KG43CmmELJCTdipNMi9PTTMzBXZTHMZQqg+HqDHE-AU+It3unHIVqoY-4BJoyEm6UaKDEr1GjVVk0pYwR2hEqUoxAmOi6lCxrEMq4BKiqdDMFYKCQvQLZIG2xhGNcjogPEuaPHCEwuj+f4AZglCpGsf7au0EjgPAmTYueYH9IMwzSnCbylnQnSmL01TFh0VzIpQCpqu0aACcQ3BEaS3IaJhDysQAygg-6pHolIYB0ejqpqB76MsdBNIB9A4JsWC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