Skip to content

4.1 Array.isArray breaking change review #41808

Description

Categorizing breaks we've seen from this

#41658, #41714

typeComparable=string|undefined|Array<string>;exportfunctioncheck<TextendsComparable>(a: T){if(Array.isArray(a)){// 4.0: m: string// 4.1: Error, cannot indexconstm=a[0];}}

#41610

constaggregatedResults: (number[]|null|'loading')[]=[[1,2],null,[3,4],'loading',[5,6]]// 4.0: onlyTheArrays: number[][]// 4:1 Error, no overload matches thisconstonlyTheArrays=aggregatedResults.filter<number[]>(Array.isArray)// number[][]

Metadata

Metadata

Labels

Fix AvailableA PR has been opened for this issueMeta-IssueAn issue about the team, or the direction of TypeScriptRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions