标签: javascript typescript
如何满足下面代码片段中的类型检查?
interface Counter { getCount: () => number increment: (n: number) => void } let c: Counter = {}
答案 0 :(得分:1)
赞
let c: Counter = { getCount: () => 1, increment: (n: number) => {} }