get members of interdace js code example
Example 1: ts interface optional parameter
interface Person {
name: string;
age: number;
phone?: string;
}
let p: Person = {name: "Ashlee", age: 29};
console.log(p);
Example 2: typescript interface function
interface IEmployee {
empCode: number;
empName: string;
getSalary: (number) => number; // arrow function
getManagerName(number): string;
}