The bug you've encountered is a tricky one, and it has to do with something called Variable Scoping and Closures.
This means that when you define a variable using var, it's important to understand where you can refer to its value,
and when its value changes.
What's happening in your code is that the entire for loop is running to completion before any of the buttons are clicked.
That means that by the time any of the buttons are clicked, the btnNum variable has a value of 3. Why 3? Because the loop
increments btnNum to the first value that btnNum < prizes.length equates to false. So, even though you define the onclick
handler each time the loop iterates with a different value for btnNum, the alert(...) statement only runs at the end of