Congrats on completing your first project without the training wheels! This is a great start.
As far as game play, the basic functionality is there, but a few more features would make it even better. The first hand I was dealt was 11 and I really wanted to double down!
var in favor of
const, and if you don’t plan on reassigning your arrays/objects then use
const for those as well. Remember, you can still alter what is inside the object or array when it is declared with
const, you just won’t be able to reassign the whole thing.
- Some useful sources to look at:
Try to find a shorter way to achieve your
shuffledDeck array and
reset function. You did the right thing, going for straightforward code that works. Now that you’ve got everything working, you can go back and refactor your code. Ideally,
reset() shouldn’t need to take up 144 lines of code. Figure out a way that makes sense to you, whether it is using loops or
.map, or something else.
Finally, have fun with this project and come back to it from time to time. If you’re feeling burnt out on the project, take a break and come back later. Each time you come back, your skills will have improved and you will see a way to make the project better.