【发布时间】:2021-09-23 23:09:42
【问题描述】:
我有以下代码:
const result: Array<{ id: string }> = list.map((x) => {
return {
id: x,
};
});
我收到以下错误,
键入'查询' 缺少来自类型 '{ studentsdcid: string; 的以下属性}[]':长度、pop、push、concat 和 22 多个.ts(2740)
不太确定我需要在这里更改什么。
【问题讨论】:
-
创建一个最小的、可重现的例子
标签: typescript