why interface in typescript sometimes need to strict to match attributes, sometimes not

前端 未结 0 1165
醉话见心
醉话见心 2021-02-07 12:05
interface LabeledValue {
  label: string;
}

function printLabel(labeledObj: LabeledValue) {
  console.log(labeledObj.label);
}

let myObj = { size: 10, label: "Siz         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题