Created
February 27, 2019 01:32
-
-
Save Maccauhuru/e2166810cbf2aa675b80beab77de61ed to your computer and use it in GitHub Desktop.
Getters & Setters Example 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const movie = { | |
name : "The Godfather", | |
year : 1972, | |
director: 'Francis Ford Coppola', | |
imdb_Rating: 9.2, | |
get movieDetails(){ | |
return ` | |
The movie : '${this.name}' was directed by ${this.director} and released in the year ${this.year}. | |
It has a very high IMDB Rating of ${this.imdb_Rating} / 10. | |
` | |
} | |
} | |
movie.movieDetails; | |
//The movie : 'The Godfather' was directed by Francis Ford Coppola and released in the year 1972. | |
//It has a very high IMDB Rating of 9.2 / 10. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment