1
此代碼導致錯誤,其文本下面給出的表達式:組合數組類型時出錯?錯誤:無法調用其類型缺少調用簽名
function getHandler(handlers: number[] | string[]): any {
return handlers.map(handler => handler);
}
錯誤文本:
error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ (this: [string, string, string, string, string], callbackfn: (value: string, index: number, ...' has no compatible call signatures.
'number [] |字符串[]'不是數組? –