Hey folks, hope you’re doing fine!
I’m stuck at the beggining of the Team Stats Project.
For some reason the program cannot read my code, and it returns this message: “SyntaxError: Unexpected token ‘:’”
It seems there’s something wrong in line 3, but I don’t see anything wrong.
What am I doing wrong?
My code so far:
const team = {
_players: [
'MichaelJordan': {
firstName: 'Michael',
lastName: 'Jordan',
age: 30
},
'Serena Williams': {
firstName: 'Serena',
lastName: 'Williams',
age: 40
},
'Louis Hamilton': {
firstName: 'Louis',
lastName: 'Hamilton',
age: 25
}
],
_games: [
game1: {
opponent: 'John',
teamPoints: 2,
opponentPoints: 1
},
game2: {
opponent: 'Belle',
teamPoints: 2,
opponentPoints: 1
},
game3: {
opponent: 'PL',
teamPoints: 2,
opponentPoints: 0
}
]
get players() {
return this._players
}
}
team.players();