-
-
Save codecademydev/cf5f77e4b3c3b386b480eff8635d67f6 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const team ={ | |
_player:[{ | |
firstname:'Steeve', | |
lastname:'Mandanda', | |
age:32 | |
}, | |
{ | |
firstname:'Konrad', | |
lastname:'De La Fuente', | |
age:21 | |
}, | |
{ | |
firstname:'Dimitri', | |
lastname:'Payet', | |
age:28 | |
}, | |
], | |
_games:[{ | |
opponent: 'Nice', | |
teamPoints: 0, | |
opponentPoints: 1 | |
}, | |
{ | |
opponent: 'Bordeaux', | |
teamPoints: 2, | |
opponentPoints: 2 | |
}, | |
{ | |
opponent: 'Montpellier', | |
teamPoints: 3, | |
opponentPoints: 2 | |
} | |
], | |
get games(){ | |
return this._games; | |
}, | |
get players(){ | |
return this._players; | |
}, | |
addPlayer(firstName,lastName,age){ | |
let player = { | |
firstName : firstName, | |
lastName : lastName, | |
age : age | |
}; | |
this.players.push(player); | |
}, | |
} | |
team.addPlayer('Steph','Curry', 28); | |
team.addPlayer('Lisa','Leslie', 44); | |
team.addPlayer('Bugs','Bunny', 76); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment