Hello
In my JavaScript code I get the following error:
"Uncaught TypeError: Can not read property 'odd' of undefined"
Since I'm new to the area, I do not understand how to solve the problem, can you help me?
case 'multiple_2_3':
total = 3 * self.card.quantity;
$("#resume-odds").hide();
//gains = (cota1 * cota2) * self.card.quantity + (cota1 * cota3) * self.card.quantity + (cota2 * cota3) * self.card.quantity
for (let i in self.card.bets) {
let bet1 = self.card.bets[i];
if(self.card.bets.length > i){
for (let j = i + 1; j < self.card.bets.length; j++) {
let bet2 = self.card.bets[j];
gains += parseFloat(bet1.odd) * parseFloat(bet2.odd) * self.card.quantity;
}
}
}
break;
case 'multiple_2_4':
total = 6 * self.card.quantity;
$("#resume-odds").hide();
for (let i in self.card.bets) {
let bet1 = self.card.bets[i];
for (let j = i + 1; j < self.card.bets.length; j++) {
let bet2 = self.card.bets[j];
gains += parseFloat(bet1.odd) * parseFloat(bet2.odd) * self.card.quantity;
}
}
break;