Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

declare function iwth interface typescript

function printLabel(labeledObj: { label: string }) {
  console.log(labeledObj.label);
}
 
let myObj = { size: 10, label: "Size 10 Object" };
printLabel(myObj);
Try
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #declare #function #iwth #interface #typescript
ADD COMMENT
Topic
Name
1+4 =