function add(a, b): number
.function add(num1: number, num2: number) {
return num1 + num2;
}
(parameter) => return value
let combineValue: (a: number, b: number) => number;
combineValue = add;
function handleAdd(n1: number, n2: number, callback: (num: number) => void){
const result = n1 + n2;
callback(result);
}
handleAdd(1, 2, (result) => {
console.log(result)
});