IT 유용한 정보

[ typescript ] 인터페이스 연습

JooKit 주킷 2021. 1. 31. 12:32
목차 접기
728x90
반응형
// 연습 
interface ConsoleFunction {
    (a: string, b: number): string
}

let test:ConsoleFunction = function(a: string, b: number ): string {
    return '제 이름은 ' + a + '이고, 나이는 ' + b + ' 입니다.';
}

let test1:string = test('해리', 30);
console.log(test1);
728x90
반응형
LIST