Some parts of the code might have:
const elem = array[index];
console.log(elem.field);
Which is dangerous because array[index] assumes elem is not null.
doing:
const elem = array[index] ?? null;
console.log(elem.field);
is also wrong because typescript won't assign "null" to elem's type
Some parts of the code might have:
Which is dangerous because
array[index]assumeselemis not null.doing:
is also wrong because typescript won't assign "null" to
elem's type