dimanche 16 mai 2021

Trying to use for...in loop and adding an if/else statement and keeps saying i am missing a ")"

const testScores = {
  John : 99,
  Jess : 78,
  Ryan : 89,
  Tom : 62,
  Jane: 57,
  Ben: 83
};

for (person in testScores){
  
       if (testScores[person] > 90){
       console.log("Well done "+ person ". You scored " + testScores[person])
  };

       else{
       console.log(person + " scored " + testScores[person])};
}

Aucun commentaire:

Enregistrer un commentaire