1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| function getTotal2(one: number, two: number): number { return one + two } getTotal2(1,2)
function sayHello(): void { console.log("Hello") }
function setTimer():never { throw new Error() console.log(123) }
function add({ one, two }: {one: number, two: number}) { return one + two }
const total = add({one: 1, two: 2})
type Callback = (a: string) => string let fn: Callback = (a) => ''
interface ICallBack { (a: string): string } let fn1: ICallBack = (a) => ''
|