Constructor in TypeScript || String Concatenation Concept

In this video,I explained how to use constructor in TypeScript. Feel free to comment. For more, please subscribe and press the BELL icon. Please visit my Angular Playlist . Please visit my YouTube Videos. The code is as follows -

constructor.ts - 
class Point {
  x: number;
  y: number;

  constructor (x: number, y: number) {
    this.x = x;
    this.y = y;
  }

  draw(){
    console.log('The value of X :- ' + this.x + '  The value of Y :- ' + this.y);
    console.log('The addition of X & Y :- ' + (this.x + this.y) );
  }

}

let point = new Point(10,20);
point.draw();


Comments

Popular posts from this blog

Alert Dialog Box in JS || JavaScript Dialog Box

HTML - Frameset Tag in html

Indian Flag || Indian Flag using HTML CSS