Javascript constructor creating new objects with same values as previously created object

前端 未结 0 416
感动是毒
感动是毒 2020-12-30 10:50

Here is my (simplified) constructor:

class User {
    constructor() {
        Object.assign(this, setup); 
    }
}

const setup = {
    name: \'\'
}

export {         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题