TypeScript - 1.8类型推论
程序员文章站
2022-07-12 15:54:19
...
上下文类型:
window.onmousedown = function(mouseEvent) {
console.log(mouseEvent.button); //error
}
window.onmousedown = function(mouseEvent: any) {
console.log(mouseEvent.button);
}