Last active
February 19, 2020 17:49
-
-
Save jasminegmp/30253dd7122424abfa902ca647c18825 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 myObject = function(obj){ | |
obj.sayName = function(){ | |
console.log(this.name); | |
} | |
} | |
let me = { | |
name: 'Jasmine' | |
} | |
myObject(me); // Initialize object | |
me.sayName(); // Invoke 'sayName' function | |
// Console will output 'Jasmine' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment