Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created August 28, 2021 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/cf5f77e4b3c3b386b480eff8635d67f6 to your computer and use it in GitHub Desktop.
Save codecademydev/cf5f77e4b3c3b386b480eff8635d67f6 to your computer and use it in GitHub Desktop.
Codecademy export
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