var numCorrect = 0;
var numWrong = 0;
function checkAnswer(numCorrect,numWrong){
var userAns = document.getElementById('ans').value;
if (userAns == x) {
numCorrect++;
}
else {
numWrong++;
console.log("wrong");
}
return numCorrect, numWrong;
}
How do i use pass by value here to increment this number by one instead of the variable reseting itself to its initial value after each run? I initialized to both to zero but it adds 1 to either value and resets to 0