I'm having Trouble trying to add a value to a counter of a character object depending on the value in the 2-d array of characters. There are multiple characters and I'm trying to find which character has the biggest counter.
function pushA() {
for(var i = 0; i < characters.length; i++) {
characters is a 2-d array the has might have a value of 1 in an index depending on the selectedindex of html code
if(characters[i].value === 1){
if statement finds which index of 2-d array has a value of 1 and pushes a value to counter
characters[i].counter.push(1);
}
else{}
}
}
pushA();
The counter is not being added to.