Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript "variable?: type" notation

// the "last" property is optional and can be undefined
function printName(obj: { first: string; last?: string }) {  // ...}// Both OKprintName({ first: "Bob" });printName({ first: "Alice", last: "Alisson" });Try
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #typescript #notation
ADD COMMENT
Topic
Name
7+8 =