Please guys help, why isn’t my code working because I failed to identify the problem.
Below is the code I have written
// Only change code below this line
if(card === 2|| card === 3||card=== 4||card===5||card===6){
count = count++;
}else if(card ===7||card ===8||card===9){
count = 0;
}else if(card ===10||card ==='J'||card ==='Q'||card ==='K'||card ==='A' ){
count = count--;
}
else {
count;
}
var holdbet = 'Hold'
if (count > 0) {
holdbet = 'Bet'
}
return count + " " + holdbet;
// Only change code above this line
}
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
ILM
December 8, 2020, 7:00pm
3
19alema:
count = count++;
19alema:
count = 0;
19alema:
count = count--;
these are not the correct ways to increase or decrease count
by 1, or to not change it
you may want to review how the shorthand works
2 Likes
Oh,
That’s great but what am I suppose to do now
Oh!
That’s great,
I deleted "count = " , and it worked.
1 Like
ILM
December 8, 2020, 7:22pm
6
good job!
now, to make it even better you could delete the parts of your code that do nothing
1 Like