4 ms·
One issue I've noticed is that indexing into a T[] array where T can't be undefined, results in the expression to be of type T, not T | undefined, despite an ou
by CryZe 5y ago
One issue I've noticed is that indexing into a T[] array where T can't be undefined, results in the expression to be of type T, not T | undefined, despite an out of bounds index evaluating to undefined. I believe I've seen that they recently added a setting that changes this though.
- cageface 5y agoA lot of statically typed languages leave array indexing as a loophole for convenience but yeah this can also be a source of errors.