typescript function with parameter example
Example 1: how to make a parameter optional in typescript
// Optional parameter
function foo(x?: number) {
console.log("x : "+ x);
}
foo();
foo(6);
Example 2: types function typescript
interface Param {
title: string;
callback: function;
}