📜  javascript代码示例中的工厂函数

📅  最后修改于: 2022-03-11 15:02:12.346000             🧑  作者: Mango

代码示例2
let john = {
    firstName: 'John',
    lastName: 'Doe',
    getFullName() {
        return this.firstName + ' ' + this.lastName;
    }
};

console.log(john.getFullName());
Code language: JavaScript (javascript)