How works table[index]+=1 in this code?And why index is +=2,+=1:This is an example in Eloquent Javascript : function tableFor(event, journal) {


let table = [0, 0, 0, 0];


for (let i = 0; i < journal.length; i++) {

let entry = journal[i], index = 0;


if (entry.events.includes(event)) index += 1;


if (entry.squirrel) index += 2;


table[index] += 1;


}
return table;


}
console.log(tableFor("pizza", JOURNAL));




