Home > Software design >  How can I make it stop counting?
How can I make it stop counting?

Time:09-05

I'm currently learning JS and I was trying to do this exercise. This is a simulate game, where I created an object with three arrays (each representing one game, so there's 3 games).

I managed to print in the console the first game average score and I want to do the same with other two games, but it keeps counting.

For example, average for 1st game is 97.66, I want it starts counting for the second game from 0 but instead it starts counting from 97.66, I thought giving a value to the 'totalScore' variable of 0 was going to fix it but it didn't.

What could I do or how would you change the code? Would you use another way? Thank you

  • Related