Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created March 11, 2018 09:23
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/3929f90f643b5c686f8849a6a8213293 to your computer and use it in GitHub Desktop.
Save codecademydev/3929f90f643b5c686f8849a6a8213293 to your computer and use it in GitHub Desktop.
Codecademy export
const team = {
_games:[{opponent: "other guy", teamPoints: 42, opponentPoints: 27},
{opponent: "ravenscroft", teamPoints: 33, opponentPoints: 66},
{opponent: "great mountain", teamPoints: 42, opponentPoints: 27},],
_players:[{firstName:"Random",
lastName:'Guy',
age:9999999999999999, },
{firstName:"cloud",
lastName:'strife',
age:999, },
{firstName:"Altiar",
lastName:'Guy',
age:99 }],
get games(){return this._games;},
get players(){return this.player;},
addPlayer(firstName, lastName, age) {
let player = {
firstName: firstName,
lastName: lastName,
age: age,
};
console.log( this.players.push(player));
},
addGame(opp, myPts, oppPts) {
const game ={
opponent: opp,
points:myPts,
opponenentPoints: oppPts
};
this.games.push(game);
},
};
team.addPlayer("Steph", "peterson", 98);
team.addPlayer("hal", "jordon", 38);
team.addPlayer("Steph", "Curry", 67);
team.addGame("Battle of 4", 100, 98);
team.addGame("Titans", 100, 98);
team.addGame("Titans", 100, 98);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment