首页 > 这个类怎么实例化 并调用对象中的start方法从而输出其中的alert(“..”)

这个类怎么实例化 并调用对象中的start方法从而输出其中的alert(“..”)

(function() {
    var Account = function() {
        this._init();
    };

    Account.prototype = {
        _init: function() {
            this.start();
        },
        start: function() {
            alert("Hello World");
        }
    }

    return Account;
});

var A =(function() {
    var Account = function() {
        this._init();
    };

    Account.prototype = {
        _init: function() {
            this.start();
        },
        start: function() {
            alert("Hello World");
        }
    }

    return Account;
});

var P = A(); 
var p = new P();
【热门文章】
【热门文章】