본문 바로가기
부트캠프교육중/TypeScript

[TS] 타입 추론

by 뭉지야 2023. 8. 17.
728x90
interface Dropdown3<T> {
    value: T;
    title: string;
}

let shoppingItem: Dropdown3<string> = {
    value: 'abc',
    title: 'hello'
}

 

 

interface Dropdown3<T> {
    value: T;
    title: string;
}
interface DetailedDropdown<K> extends Dropdown3<K>{
    description: string;
    tag: K;
}

let detailedItem: DetailedDropdown<string> ={
    description: 'ab',
    tag: 'a',
    value: 'a',
    title: 'gg',
}
728x90