3 ms·
For array types, I don't think there's a way. You can type x as a tuple like this: const x: [number, number] = [1, 2]; In which case you'll only be able t
by jakelazaroff 7y ago
For array types, I don't think there's a way. You can type x as a tuple like this:
const x: [number, number] = [1, 2];
In which case you'll only be able to access indices zero and one.