Team Stats- Javascript exercise- Help!

This is my first post, so im going to do my best on this.
Basically having a problem with the Team Stats Exercise (link- 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 = {


     {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,




   addGame(oppName, points, addPoints) {

     const game = {

          opponent: oppName,

          points: points,

          opponentPoints: addPoints,




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

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

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


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

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

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

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:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.