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])};
}
+
between person
and ". You scored "
;
after if block, because of that, it program didn't compile.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]);
}
}