I have a question about how could I leverage typescript to warn about an array that could cause a run time error ? I have the following code I usually use a question mark after the array .. but should typescript know that this might cause a runtime error ?
// cause run time erorr..
context.arr[props.id].includes(select)
// no run time erorr
context.arr[props.id]?.includes(select)
context.arr[props.id]that might be undefined, that's just finecontext.arr[props.id]potentially undefined by enablingnoUncheckedIndexedAccess. It can introduce a lot of noise in existing code base, but still possible