There was an error while loading. Please reload this page.
TS 2.0.3
const xs = [1,2,3]; const x5 = xs[5]; // type is number, expected number | undefined
The type system doesn't know of care about the length of xs, so I would expect any lookup in the array to return T | undefined.
xs
T | undefined
TS 2.0.3
The type system doesn't know of care about the length of
xs, so I would expect any lookup in the array to returnT | undefined.