cessig / hangman-game

Project Zero Hangman
0 stars 0 forks source link

Project 0 Feedback #1

Open micahwierenga opened 4 years ago

micahwierenga commented 4 years ago

Corey, there's a lot of great stuff in your app, and well done on making it fully playable in the DOM! And, with a win condition, your project meets all the requirements.

I found the game fun to play myself, which is exactly what we're going for. In the next comment, I'll make a suggestion to improve your code.

micahwierenga commented 4 years ago

The biggest improvement, I think, would be to refactor your inline event listeners. So, instead of using the onclick attribute to add listeners like in this example:

<button id="startButton" onclick="startGame()" class="nes-btn is-primary">

add the listeners in your JavaScript like this:

$('#startButton').on('click', startGame);

The reason is that, if you need to add additional click event listeners to that element, you can. Or, if you want to add that startGame function as a listener to multiple elements, it's much more efficient to do it in your JS.

I look forward to seeing more of your work!