Open ynchuan opened 4 years ago
interface Fn { (name: string): number } const fn1: Fn = function (name) { return name.length } const fn2 = function (name: string): number { return name.length } const fn3 = (name: string): number => { return name.length } function fn4(name: string): number { return name.length }
函数