SOURCE

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);
console 命令行工具 X clear

                    
>
console