Tell us what’s happening:
can someone please help me i don’t understand the whole challenge
Your code so far
var count = 0;
function cc(card) {
// Only change code below this line
switch(card){
}
return "Change Me";
// Only change code above this line
}
// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0.
You run the same function several times which affects the global variable.
So you control what happens to the count depending on the card.
Note that different “cards” or inputs would produce a different result.
Well, you already started your switch statement. Now you need to add the different cases inside of it for each card that could be passed in, with appropriate actions for each case. Because multiple cases will prompt the same action (e.g. cards 2, 3, 4, 5, 6 all need to increment the count) you can combine them. Take a look at “Multiple Identical Options in Switch Statements” lesson in Basic JavaScript Section: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements