Team Stats- Javascript exercise- Help!

Hi
This is my first post, so im going to do my best on this.
Basically having a problem with the Team Stats Exercise (link- https://www.codecademy.com/paths/web-development/tracks/web-dev-js-arrays-loops-objects/modules/learn-javascript-objects/projects/team-stats)- I have gone through completing it using the video as a guide, compared both my code and the one presented on the video, however at task 7 where it ask to print out the team players, the end result came up as ‘undefined.’ I went through to the end of the task and added the scorekeeper info and again it comes up with ‘undefined’ again, twice to reflect what should be team players and scores. Any help on this would be appreciated, scanning code over to see if i have made a slight error (which i do a lot) and still at a lost!
Here is the code i have created…

const team = {

   _players:[

     {firstName: "Dave", lastName: "Smith",

      age: 24},

     {firstName: "Fellipe", lastName: "Lopez",

      age: 21},

      {firstName: "David", lastName: "Silva",

      age: 29}

   ],

   _games: [

       {opponent:"West Ham", teamPoints: 5, opponentPoints: 1},

       {opponent: "Liverpool", teamPoints: 3,

       opponentPoints: 3},

       {opponent: "Burnley", teamPoints: 6, opponentPoints: 0}   

   ],

   get players() {

     return this._players;

   },

   get games() {

     return this._games;

   },

   addPlayer (firstName, lastName, age) {

     let player ={

       firstName: firstName,

       last: lastName,

       age: age,

     };

     this.players.push(player);

   },

   addGame(oppName, points, addPoints) {

     const game = {

          opponent: oppName,

          points: points,

          opponentPoints: addPoints,

     }

     this.games.push(game);

   }

}

team.addPlayer("Steph", "Curry", 28);

team.addPlayer("Lisa","Leslie", 44);

team.addPlayer("Bugs","Bunny", 76);

console.log(team.Players);

team.addGame("West Ham", 4, 2);

team.addGame("Burnley" , 2, 1);

team.addGame("Liverpool", 4, 1);

console.log(team.game);
1 Like

Hello, and welcome to the forums!

We can help you out. You can post your code to the forum and we’ll see what you’re working with.

Be sure to use this option so that it looks correct after the forum reformats it:
image