Created
December 5, 2016 16:24
-
-
Save smks/84e2a8c6fdf4488077857f0477c9e927 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
const batman = {firstName: 'Bruce', lastName: 'Wayne'}; | |
const superman = {firstName: 'Clark', lastName: 'Kent'}; | |
function speak(quote, location) { | |
console.log(this); | |
console.log(this.firstName + ' ' + this.lastName + ' ' + 'says ' + quote + ' from ' + location); | |
}; | |
// Apply for Array | |
speak.apply(batman, ["'It's not who I am underneath, but what I do that defines me'", "Gotham City"]); | |
speak.apply(superman, ["'Dreams save us. Dreams lift us up and transform us'", "Metropolis"]); | |
// Call for Comma | |
speak.call(batman, "'It's not who I am underneath, but what I do that defines me'", "Gotham City"); | |
speak.call(superman, "'Dreams save us. Dreams lift us up and transform us'", "Metropolis"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment