Instantly share code, notes, and snippets.

What would you like to do?
var customer = {
firstName: "John",
lastName: "Doe",
greetCustomer: function(){
// We use "this" instead of repeating "customer"
console.log("Hello again " + this.firstName + " " + this.lastName + "!");
customer.greetCustomer(); // Prints "Hello again John Doe!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment