0

methodTwoからmethodOneを呼び出すにはどうすればよいですか?

安全で正しい方法はありますか?

$(document).ready(function () {
    var classOne = new ClassOne();
    var classTwo = new ClassTwo();
});

var ClassOne = (function (window, document, Math, undefined) {

    function ClassOne () {
    }

    ClassOne.prototype = {
        methodOne: function () {
            console.log('method one');
        }
    };

    return ClassOne;
})(window, document, Math, undefined);

var ClassTwo = (function (window, document, Math, undefined) {

    function ClassTwo () {
    }

    ClassTwo.prototype = {
        methodTwo: function () {
            // how to call?
            // classOne.methodOne()
        }
    };

    return ClassTwo;
})(window, document, Math, undefined);
4

1 に答える 1