代码
提交代码
interface Clothes { color: string; size: string; price: number; } function getClothesInfo(clothes: Clothes) { console.log(clothes.price) } let myClothes: Clothes = { color: 'black', size: 'XL', price: 98 } getClothesInfo(myClothes)
运行结果