I want to write several variables into an array for one call to the "addLetter" method, "push" and "concat" does not work
function Team(name) {
this.name = name;
this.letters = [];
}
Team.prototype.addLetter = function (letter) {
this.letters.push(letter).join('\n');
};
Team.prototype.toString = function () {
return "Name of team - " + this.name + '\n' +"ltters : " + this.letters;
};
var a = 's';
b='g';
v='d';
var team1 = new Team('letters');
team1.addLetter(a,b,v);
console.log(team1.toString());
addMember, so that's causing an error.addMemberdeclaration?Array.prototype.pushreturns an integer rather than an array.