I need help with the following exercise:
Develop a function that punctuates a hand of cards, which has as parameter an array of letters, each one represented by a dictionary with suit and value. When scoring, the cards add their value except if it is an ace that adds 20.
Declare the letters as 1, create the array with all the letters in it and the code, but the code does not give me the desired result and I do not know what I am doing wrong
carta1 = {PALO:"c",VALOR:1}
carta2 = {PALO:"d",VALOR:7}
carta3 = {PALO:"p",VALOR:5}
cartas = [carta1,carta2,carta3];
function puntua(mano){
var mano = 0
for (var i = 0; i < cartas.length; i ++) {
if (cartas[i].valor === 1) {
mano = mano + cartas[i].valor + 20;
} else {
if (cartas[i].valor != 1) {
mano = mano + cartas[i].valor;
}
console.log(puntua(mano))
}
}
}