Quick actions

cmd+k|ctrl+k

Navigation

Languages

Movie

Snippet info

Language

JavaScript

Visibility

public

Author

soham57

Created

2022-05-21T05:14:54.932552Z

Updated

2022-05-21T05:14:54.932552Z

class Movie{

	constructor(title,director,genre,releaseDate,rating){
		
		this.title=title;
		this.director=director;
		this.genre=genre;
		this.releaseDate=releaseDate;
		this.rating=rating;
		
	}
	
	getOverview=()=>{
	
		return(`${this.title}, a ${this.genre} film directed by ${this.director} was released in year ${this.releaseDate}. It received a rating of ${this.rating}.`)
	}
	

}
const Spiderman = new Movie("Spiderman", "Sam Raimi", "Action", 2002, 87);
const Batman = new Movie("The Dark Knight", "Christopher Nolan", "Action", 2008, 83);
console.log(Spiderman);
console.log(Spiderman.getOverview());
console.log(Batman.getOverview());
INFO