Slide 21
Slide 21 text
Interface
interface Hoge {
firstName: string,
lastName: string,
action: () => void,//
};
const hoge: Hoge = {
firstName: 'Daiki’,
lastName: 'Kojima’,
action: () => {
console.log('hogehoge’);
},
};
function doHoge(hoge: Hoge) {
hoge.action();
}
doHoge(hoge);// hogehoge