SOURCE

let cat1 = {
    name: 'nac',
    age: 11
}

let cat2 = {
    name: 'xx',
    age: 12
}

function createCat(name, age){
    let obj = new Object()
    obj.name = name
    obj.age = age
    return obj
}

let cat3 = createCat('haha', 14)
console.log(cat3)


function createCat1(name, age){
    this.name = name
    this.age = age
    this.bark = () => {
        console.log(this.name + '++++++')
    } 
}

let cat4 = new createCat1('who',24)
console.log(cat4)
console 命令行工具 X clear

                    
>
console