#newCards( ) function not working

1 messages · Page 1 of 1 (latest)

shut rover
#

Hey all, me again. So my blackjack game was working fine, I have just added in the if statement to check isAlive and hasBlackJack in my newCard function and now I can't select a new card. This code works in my notes, but in this scrim, it's not. Any ideas? Not getting any errors so very confused https://scrimba.com/scrim/co743401484e5a2edaa98a399

BTW, If I remove the is statement, so take it to original code, it works... 😦

Scrimba

Learn to code with interactive screencasts. Our courses and tutorials will teach you React, Vue, Angular, JavaScript, HTML, CSS, and more. Scrimba is the fun and easy way to learn web development.

rancid lark
#

You have a following condition in your function:
if (isAlive === true && hasBlackJack === false)

but you actually never set isAlive to true, it is initially set to false.

shut rover
#

🫣 Ah man...missed that bit!! Thank you! Knew I had to have missed something. @rancid lark you saved my a lot of swearing!!