Last active
February 19, 2020 17:59
-
-
Save jasminegmp/442d0b5383d2c2efb8adb3cf9f3cefa3 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 createUser = function(name){ | |
return{ | |
name, | |
sayNames: function() {console.log(this.name)}, | |
dog: { | |
name: 'Jello', | |
sayNames: function() {console.log(name + "'s dog's name is " + this.name)} | |
} | |
} | |
} | |
let jasmine = createUser('Jasmine') // initialize object | |
jasmine.sayNames(); // will console.log out 'Jasmine' | |
jasmine.dog.sayNames(); // will console.log out 'Jasmine's dog's name is Jello' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment