Ts报错:Type ‘Function | undefined‘ is not assignable to type ‘Function‘;Cannot invoke an object
报错Type ‘Function | undefined’ is not assignable to type ‘Function’.Type ‘undefined’ is not assignable to type ‘Function’.意思是:类型’Function | undefined’不能赋值给类型’Function’。类型’undefined’不能赋值给类型’Function’。解决:将类型定义为Function | undefined const myFun: Function