Function.prototype.addMethod = function(name, fn){
this.prototype[name] = fn;
}
var Methods = function(){};
Methods.addMethod('checkName', function(){
// 验证姓名
}).addMethod('checkEmail', function(){
// 验证邮箱
});
使用
var m = new Methods();
m.checkEmail()