TypeScript

by Saksham Malhotra

TypeScript

interface Book {
title: string;
author: string;
GetAuthor():void;
GetTitle() => void;
}

class English implements Book {
	constructor(private title: string, private author: string) {}
  
  GetAuthor():void {
  	alert(`author is ${this.author}`);
  }
  
  GetTItle():void {
  	alert(`title is ${this.title}`)
  }
}

var book = new ENglish('story','rob');
book.GetTitle();
book.GetAuthor();