函数类型与void类型
来源:7-10 函数类型与void类型

小雨点3545254
2023-11-10
let foo = function (): undefined {
}
我的ts版本是5.2.2,这段代码并没有报错,显示正常,这是怎么回事,老师能详细的解释一下吗
写回答
1回答
-
西门老舅
2023-11-10
你好,从5.1开始就改了。可以看这个链接:https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-1.html
022023-11-13
相似问题