Created
June 9, 2018 16:03
-
-
Save sevperez/04259e5e671d581ccacea782598d7da4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // option 1 | |
| var theater = { | |
| playMovie: function(movie, previewLength) { | |
| this.loadProjector(movie); | |
| setTimeout(function() { | |
| console.log("Now playing: " + this.movie); | |
| }.bind(this), previewLength); | |
| } | |
| } | |
| // option 2 | |
| var theater = { | |
| playMovie: function(movie, previewLength) { | |
| var self = this; | |
| this.loadProjector(movie); | |
| setTimeout(function() { | |
| console.log("Now playing: " + self.movie); | |
| }, previewLength); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment