Life Developer
인생 개발자
[typescript]interface-함수를 프로퍼티로

interface Person{

    name:string,

    hello():string,

}

 

const person:Person = {

    name:'kim',

    hello:():string=>{return 'hello'},

}

 

interface Person1{

    name:string,

    hello?():string,

}

 

const person:Person1 = {

    name:'kim',

}

  Comments,     Trackbacks