157
rated 0 times
[
161]
[
4]
/ answers: 1 / hits: 23408
/ 7 Years ago, sat, november 4, 2017, 12:00:00
new to ng4/typescript and having some difficulty. How do I sum the items in an array?
Added screenshot of what it looks like in action for example
for (let card of this.cards) {
for (let val of card.cards){
if(val.value == JACK){
val.value = 10;
}
if (val.value == QUEEN){
val.value = 10;
}
if (val.value == KING){
val.value = 10;
}
if (val.value == ACE){
val.value = 10;
}
this.hand = Number(val.value) + Number(val.value); (I'm sure this is wrong)
}
}
More From » arrays