is there a simplest way of iterating over an array of arrays in this sample of JSON
"game": {
"sunk_ships": [
[
"PatrolBoat",
"Destroyer"
]
]
}
in my code this is what i wrote having in mind former questions answered
for (let i = 0; i < this.getGamePlayerId.sunk_ships.length; i++) {
let childArray=parent[i];
for (let j = 0; j < parent[i].length; j++) {
var innerValue=parent[i][j]
console.log(parent[i][j]);
document
.getElementById(innerValue)
.classList.add("shipDestroyed");
}
}
thanks