(function () {
var user = '';
Box = function (value) {
user = value;
}
Box.prototype.getUser = function () { //share
return user;
}
})();
var a1 = new Box("Lee");
alert(a1.getUser());
var a2 = new Box("JIN");
alert(a1.getUser());
class prototype 共享内存
最新推荐文章于 2023-02-01 15:16:43 发布