I want to create a new array as an attribute of the object once I create a new instance. But I get the following error in Chrome: "Uncaught TypeError: Cannot call method 'push' of undefined". Players seems to be unkown. But why?
function Team(name) {
this.Name = name;
this.Players = new Array();
}
Team.prototype.AddPlayer = new function (player) {
this.Players.push(player); //error
}