You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interface ObjINF1 {
[key: string]: string | number | undefined;
}
interface ObjINF2 {
id: number;
title: string;
}
function a1(objArr: ObjINF1[]) {
}
function a2(objArr: ObjINF2[]) {
// Argument of type 'ObjINF2[]' is not assignable to parameter of type 'ObjINF1[]'.Type 'ObjINF2' is not assignable to type 'ObjINF1'. Index signature is missing in type 'ObjINF2'.
a1(objArr)
}
function a3(objArr: {
id: number;
title: string;
}[]) {
a1(objArr)
}
为什么a2报错了 a3 反而正确
The text was updated successfully, but these errors were encountered:
为什么a2报错了 a3 反而正确
The text was updated successfully, but these errors were encountered: