Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript class

export class Ingredient{
  //This is a shortcut to what is written below 
  constructor(public name:String, public amount:String){}
}

// On top is the same as below 
//
// export class Ingredient{
//     public name: String;
//     public amount: Number;
    
//     constructor(name:String , amount:Number) {
//         this.name = name;
//         this.amount = amount;
//     }
// }

Source by www.udemy.com #
 
PREVIOUS NEXT
Tagged: #typescript #class
ADD COMMENT
Topic
Name
8+6 =