Last active
February 20, 2020 02:29
-
-
Save jasminegmp/a58221686fb488d2e994c18d0a79c44c 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 john = { | |
name: 'John' | |
} | |
let hobbies = ['painting', 'cooking', 'biking']; | |
let setName = function(hobby0, hobby1){ | |
console.log(this.name + "'s hobbies are " + hobby0 + " and " + hobby1); | |
} | |
setName.apply(john, hobbies); | |
// will output "John's hobbies are painting and cooking" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment