let sex = '男'; let age = 22; let person = { sex, age, sayName(name) { console.log(`My name is ${name}`); } }; person.sayName('张三') console.log(person.sex, person.age);