0
Hello!
In my Javascript code I get the following error:
"Uncaught Typeerror: Cannot read Property 'Odd' of Undefined"
Since I’m new in the area, I don’t quite understand how to solve the problem, you can 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;
I have already reviewed and seem to me rights , he in the first for has values in the second is that it seems to lose them
– Joana
@Joana if you haven’t solved the problem do a jsFiddle that plays what you have that I take a look and help.
– Sergio
my code is too big and has several.js files and all interconnected to just pull this , I can give the link of the site and can see find on the console and this
– Joana
@Joana ok, put the link to see if it can help
– Sergio
is this, thank you https://projectos.epcjc.net/~i15575/pap_joana1/
– Joana