I am experiencing some weird behaviour in TypeScript (v4.6.2). Why does (a) work but (b) and (c) don't?
const a: string[] | null = []
if (a?.length > 1) {
console.log(1)
}
const b = [] as (string[] | null)
if (b?.length > 1) {
console.log(1)
}
const c: string[] | null = [] as (string[] | null)
if (c?.length > 1) {
console.log(1)
}
