Javascript - Array question!!!
This code is in the book Head Frist. var scores = [60, 50, 60, 58, 54, 54, 58, 50, 52, 54, 48, 69, 34, 55, 51, 52, 44, 51, 69, 64, 66, 55, 52, 61, 46, 31, 57, 52, 100, 18, 41, 53, 55, 61, 51, 44]; var lowScore = 0; var output; 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); The out output for: console.log("Highest bubble score: " + highScore); is 69 and i dont know how could Javascript do it? // this section i don't know how if (scores[i] > highScore) { highScore = scores[i]; } Can you explain it for me, how could it could 69 as highest value, thank you.