1.写成返回值这种:function re(){ let myname = 123 let set = { 'name' = function(name){ myname = name } } let get = { return myname }}2.对象类function re(){ this.myname = 123 this.set = { 'name' = function(name){ this.myname = name } } this.get = { 'name' = function(){ return this.myname } }}var hh = new re().set.name('aaa');alert(hh.get.name())大家给我指点一下
添加回答
举报
0/150
提交
取消