function Demo(name,age){ this.name = name this.age = age this.sing = function(){ console.log(this.name + "唱歌") } } let lx = new Demo('张三',10) lx.sing()