//对象定义
var riken = function () {
return new riken.prototype.init();
}
//初始化
riken.prototype.init = function () {
}
///定义事件
riken.prototype.sayHello = function (userName) {
alert('Hello,' + userName);
}
//实现方法继承
riken.prototype.init.prototype = riken.prototype;
(function (p) {
console.log(p.getUTCFullYear());
debugger;
riken().sayHello('riken');
})(new Date());
转载于:https://my.oschina.net/u/170072/blog/530339