diff --git a/object_oriented_javascript/playlist/app.js b/object_oriented_javascript/playlist/app.js index 04b3e9d..6619a23 100644 --- a/object_oriented_javascript/playlist/app.js +++ b/object_oriented_javascript/playlist/app.js @@ -2,9 +2,11 @@ var playlist = new Playlist(); var hereComesTheSun = new Song("Here Comes the Sun", "The Beatles", "2:54"); var walkingOnSunshine = new Song("Walking on Sunshine", "Katrina and the Wave", "3:43"); +var manOfSteel = new Movie("Man of Steel", 2013, "2:23:00"); playlist.add(hereComesTheSun); playlist.add(walkingOnSunshine); +playlist.add(manOfSteel); var playlistElement = document.getElementById("playlist"); diff --git a/object_oriented_javascript/playlist/movie.js b/object_oriented_javascript/playlist/movie.js new file mode 100644 index 0000000..257192a --- /dev/null +++ b/object_oriented_javascript/playlist/movie.js @@ -0,0 +1,22 @@ +function Movie(title, artist, duration) { + Media.call(this, title, duration); + this.year = year; +} + +Movie.prototype = Object.create(Media.prototype); + +Movie.prototype.toHTML = function() { + var htmlString = '