const address = {
 street: 'Dique 3',
 city: 'Santa Cruz',
 zipcode: 38320,
 function showAddress {
  console.log(`${this.street}, ${this.city}, ${this.zipcode}`)
 }
}

address.showAddress();

1 Answers

1
Maheer Ali On Best Solutions

You are add methods the wrong way.

const address = {
 street: 'Dique 3',
 city: 'Santa Cruz',
 zipcode: 38320,
 showAddress(){
  console.log(`${this.street}, ${this.city}, ${this.zipcode}`)
 }
}

address.showAddress();