JavaScriptPatterns
JavaScriptPatterns copied to clipboard
Chapter3 Builder.js tournament.events.push
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;
})();