JavaScriptPatterns icon indicating copy to clipboard operation
JavaScriptPatterns copied to clipboard

Chapter3 Builder.js tournament.events.push

Open imrek opened this issue 8 years ago • 0 comments

Hello,

shouldn't the Tournament class actually have something like this.events = [];? Because when you run code likes this:

var tournament = new Tournament();
tournament.events.push(new Event("Joust"));

the tournament object will not have an events property if you define the class like this:

var Tournament = (function () {
        function Tournament() {
        }
        return Tournament;
})();

imrek avatar Jul 28 '16 07:07 imrek