Q:

Can't understand part of if/for loop

Working through a book called "head first javascript programming" and got into this practice example but I don't quite understand some part of it. I'm supposed to make it so that in console it displays the amount of tests and highest score. Here's the code.
var scores = [60,58,34,69,46,41,50,50,55,64,31,53,60,52,51,66,57,55,58,54,52,55,52,61,54,48,44,52,44,51,54,69,51,61,18,44];
var output;
var highScore = 0;

for(var i = 0; i < scores.length; i++){
  output = "Bubble solution #" + i + " score: " + scores[i];
  console.log(output);
  if (scores[i] > highScore){
    highScore = scores[i];
  }
}

console.log("Bubbles tests: " + scores.length);
console.log("Highest bubble score: " + highScore);

Now this code does work but I don't understand these two lines here:
scores[i] > highScore
highScore = scores[i]

A:

The goal is to know what score is the highest.
  if (scores[i] > highScore){
    highScore = scores[i];
  }

Thus while iterating over each scores. We check if the current iterating score is higher than highScore. If it is the case, we update the highscore with the current score.

Iteration 1 

scores[i] = 60
highscore = 0
--> highScore = 60

Iteration 2 

scores[i] = 58
highscore = 60
 --> highscore = 60

