var A = new function(){
this.i = '1';
this.s = 'hello'
this.foo = function () {};
};
A.prototype.foo_2 = function () {};
var a = new A();
a.foo();
a.foo_2();
//singelton
var a = {
i: '1',
s: 'hello',
foo: function(){};
};
this.i = '1';
this.s = 'hello'
this.foo = function () {};
};
A.prototype.foo_2 = function () {};
var a = new A();
a.foo();
a.foo_2();
//singelton
var a = {
i: '1',
s: 'hello',
foo: function(){};
};
No comments:
Post a Comment