Why does the Javascript code on my Hugo markdown file not work?

Under Question 9 on this page, I have four buttons, and I have described the action to take in this JS file. I have included the JS on the page as well. However while the code works perfectly on JSFiddle, Hugo is unable to reproduce the button click action as expected.

Can someone help me out with this?

Check the browser devtools console, i found this:

Uncaught SyntaxError: Identifier ‘buttons’ has already been declared (at click_action.js:1:1)