HJ90,
var $ = function (some) {
if (!(this instanceof $)) {
return new $(some);
}
console.log(some);
};
$.prototype.method1 = function () {
console.log(1);
return this;
};
$.prototype.method2 = function () {
console.log(2);
return this;
};
$.prototype.method3 = function () {
console.log(3);
return this;
};
$('test').method1().method2().method3().method1().method2().method3();//...
$('test').method1();
var t = $('test');
t.method2();