[Solved] Iterate over JS [closed]


You where comparing the wrong array in your code, you can fix it like following:

for (var currentPokemon in FullGame.pokemon) { // HERE added .pokemon at the end
  if (FullGame.pokemon[currentPokemon].name == name) {
    var Detail = FullGame.pokemon[currentPokemon];
    alert(Detail);
  } else {
    alert("Type Again");
  }
}

3

solved Iterate over JS [closed]