Sorry for the strange title, it woudn't let me post the question otherwise. Essentially, I would like to update the count of a variable that is chosen depending on the function input. Here is a simplified version. In my code I have around 30 count variables. The countOne function input would be either 1,2 or 3 and would thus update the relevant count1,count2, or count3 depending on the input.
let count1 = 0;
let count2 = 0;
let count3= 0;
function countNumber(countOne, sum) {
count[countOne] = count[countOne] + sum;
}