I'm working on my first javascript project and can't figure out what is wrong with this function.
function calculateAttackValue(deck) {
for (let i = 0; i < deck.length; i++) {
if (deck[i].Value == 'two' || 'three' || 'four' || 'five' || 'six' || 'seven' || 'eight' || 'nine' || 'ten') {
deck[i].attackValue = wordsToNumbers(deck[i].Value)
} else if (deck[i].Value == 'king' || 'queen' || 'jack') {
deck[i].attackValue = 10
} else {
deck[i].attackValue = 0
}
}
};
What I intended to happen was for each card with a value of "king" "queen" or "jack" to have an attack value of 10 and a value of "ace" have an attack value of 0. The first part of the if statement works and assigns the attack value property correctly but the rest are returning the strings of "king""queen""jack" and "ace" instead of the intended 10s and 0.
What have I done wrong?