0

I'm writing a Blackjack program in Javascript and I'm having issues finding the error in my code. When I debug in Chrome it tells me when I click each of my buttons that the corresponding function is undefined. I can't seem to find the error so hopefully you all can! Thank you in advance.

3
  • 3
    You are missing a } for ...else if (playerscore > dealerscore... . Commented Nov 12, 2013 at 23:52
  • 1
    @Deafsilver: For future reference: please provide executable examples. You may want to us JSFiddle for this, like so: jsfiddle.net/JcuKf Commented Nov 12, 2013 at 23:53
  • 2
    Please debug, track down the problem, isolate code and post live demo if possible to reproduce the issue. Also I suggest reading about DRY. Maybe when you get it working you could seek advice at CodeReview Commented Nov 12, 2013 at 23:53

1 Answer 1

1

That's because you have a syntax error in your code, so none of the code in the script tag is executed.

You are missing a closing } for the last if statement in the last function.

Sign up to request clarification or add additional context in comments.

2 Comments

Annnnnnnnd now I feel like an idiot. Thank you very much for that haha.
We've all been there, @Deafsilver . . . sometimes you just need another pair of eyes to take a look. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.