###JavaScript### Hi,
The main problem of this code is the variable scope of btnNum. When you define onclick callback function, it will not be called immediately, but will be triggered when users click one of the buttons. And by the time when users click a button, the btnNum is already set to 3. (It increments three times from zero to three.) And the onclick callback function will use the last btnNum value - 3 to run the callback function and since prizes array don't have corresponding element with the index of 3. ** prizes[btnNum] ** return undefined.
The following is the working version of code for your reference. Please let me know if you have further question. Happy to walk through this code with you in the call.
var prizes = ['A Unicorn!', 'A Hug!', 'Fresh Laundry!'];