Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Team(name) {
- this.name = name;
- this.letters = [];
- }
- Team.prototype.addLetter = function (letter) {
- this.letters.push.apply(this.letters.push, arguments).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());
Add Comment
Please, Sign In to add comment