Created
June 9, 2018 15:53
-
-
Save sevperez/786f7fba642a1a314ab4a40c2e80a791 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
function setMovie(movie) { | |
this.movie = movie; | |
} | |
var theater = { | |
loadProjector: setMovie.bind(theater), | |
}; | |
var television = {}; | |
theater.loadProjector.call(television, "Top Gun"); | |
console.log(television.movie); // undefined | |
console.log(theater.movie); // "Top Gun" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment