In the JSON dataset provided, there seems to be an issue with the loop only iterating through the first pokemon, Bulbasaur. When typing in names of other pokemons such as "Ivysaur" or "Venusaur", it simply shows "Not found". Take a look at the code snippet below for reference.
let findpokemongame = {https://raw.githubusercontent.com/Biuni/PokemonGO-Pokedex/master/pokedex.json} //click the link to find the JSON dataset
var findname = window.prompt("Enter Pokemon Name")
let checkname = function(findname, findpokemongame) {
for (let thispokemon in findpokemongame.pokemon) {
if (findpokemongame.pokemon[thispokemon].name == findname) {
let pokemondetails = findpokemongame.pokemon[thispokemon];
console.log(pokemondetails);
for (info in pokemondetails) {
if (typeof pokemondetails[info][0] === 'object') {
pokemondetails[info] = pokemondetails[info].map(o => o.name)
}
alert(info + " : " + pokemondetails[info] + "\n")
}
}
else{
alert('Not found');
break;
}
}
}
checkname(findname, findpokemongame)