const address = {
street: 'Dique 3',
city: 'Santa Cruz',
zipcode: 38320,
function showAddress {
console.log(`${this.street}, ${this.city}, ${this.zipcode}`)
}
}
address.showAddress();
答案 0 :(得分:1)
您添加方法的方式错误。
const address = {
street: 'Dique 3',
city: 'Santa Cruz',
zipcode: 38320,
showAddress(){
console.log(`${this.street}, ${this.city}, ${this.zipcode}`)
}
}
address.showAddress();