Skip to content

Instantly share code, notes, and snippets.

@lenafaure
Created May 7, 2017 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lenafaure/107cbe06f436872899615e6ce879c334 to your computer and use it in GitHub Desktop.
Save lenafaure/107cbe06f436872899615e6ce879c334 to your computer and use it in GitHub Desktop.
var customer = {
firstName: "John",
lastName: "Doe",
greetCustomer: function(){
console.log("Hello again " + this.firstName + " " + this.lastName + "!");
},
whatIsMyObject: function() {
console.log(this);
}
}
customer.greetCustomer(); // Prints "Hello again John Doe!"
customer.whatIsMyObject(); // Prints the object "customer" in the console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment