In this code
const arr = ['hello', 'world'];
const x = arr[2];
const y = arr[0.5];
arr is a string[], and 10 and 0.5 are numbers, so TS implies that 10 and 0.5 can index arr, therefore inferring that x and y are strings too, while at runtime they'll be undefined.
Is there a configuration option I can write in my tsconfig.json that basically tells typescript "if you're not sure that arr: T[] has an element at i, do not infer that arr[i] is a T"?
 
    