I have this Javascript object generated from my code and player object is
const player = {
cards: []
}
My question is how do I loop through all my card in player object and replace all the "A" faceValue to 1? Using findIndex or splice?
player: Object
cards: Array(2)
0: Array(1)
0: card {suit: "spades", face: "7", faceValue: 7}
length: 1
__proto__: Array(0)
1: Array(1)
0: card {suit: "clubs", face: "A", faceValue: 11}
length: 1
1: Array(2)
0: card {suit: "spades", face: "A, faceValue: 11}
length: 1