Created
September 4, 2020 02:20
-
-
Save GAierken/5c69346d0dd6fc00784ce38d594d18c4 to your computer and use it in GitHub Desktop.
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
let movie1 = function () {} | |
movie1.prototype.description = function() { | |
return "description of movie1" | |
} | |
let movie2 = function() {} | |
movie2.prototype = Object.create(movie1.prototype); | |
movie2.prototype.description = function() { | |
return "description of movie2" | |
} | |
let movie3 = function() {} | |
movie3.prototype = Object.create(movie1.prototype); | |
movie3.prototype.description = function() { | |
return "description of movie3" | |
} | |
let movies = [new movie1(), new movie2(), new movie3()]; | |
movies.forEach(function(movie){ | |
console.log(movie.description()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment