-
-
Save codecademydev/3929f90f643b5c686f8849a6a8213293 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 = { | |
_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