Tell us what’s happening:
When I tried running this code in Google chrome then this code passed all the TEST given on FreeCodeCamp website but when I am submitting this code on https://www.freecodecamp.org/ then it is giving following output in console and I am not able to submit this code.
**Output in Console on freecodecamp.org**
// running tests
Cards Sequence 7, 8, 9 should return the string 0 Hold
Cards Sequence 10, J, Q, K, A should return the string -5 Hold
Cards Sequence 3, 7, Q, 8, A should return the string -1 Hold
Cards Sequence 3, 2, A, 10, K should return the string -1 Hold
// tests completed
**Your code so far**
let count = 0;
function cc(card) {
// Only change code below this line
const arrPlus=[2, 3, 4, 5, 6];
const arrZero=[7, 8, 9];
const arrMinus=[ 10, 'J', 'Q', 'K', 'A'];
arrPlus.forEach(funcPlus);
function funcPlus(value, index, array){if (value==card){count++;}}
arrMinus.forEach(funcMinus);
function funcMinus(value, index, array){if (value==card){count--;}}
arrZero.forEach(funcZero);
function funcZero(value, index, array){if (value==card){count-=0;}}
if (count>0){return count+' Bet';}
else if(count<=0 ){return count+' Hold ';}
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Counting Cards
Link to the challenge: