Type Script - Class
Create a Class:
FileName: *.ts
Class Customer{
firstName : string;
lastName : string;
constructor(theFirst:string, theLast:string){
this.firstName = theFirst;
this.lastName = theLast;
}
}
Lets use class,
let mycustomer = new Customer("Vinoth", "Kumar");
console.log(mycustomer.firstName);
FileName: *.ts
Class Customer{
firstName : string;
lastName : string;
constructor(theFirst:string, theLast:string){
this.firstName = theFirst;
this.lastName = theLast;
}
}
Lets use class,
let mycustomer = new Customer("Vinoth", "Kumar");
console.log(mycustomer.firstName);
Comments
Post a Comment