1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| function log<T>(value: T): T { console.log(value); return value; }
log<string[]>(['a','b']); log(['a','b'])
// type Log = <T>(value: T) => T // let myLog: Log = log;
interface Log<T = string> { (value: T): T } let myLog: Log = log myLog('1');
|