gainedAbilities = {
const gainedAbilities = {}
for (const pokemon of pokedexList) {
if (pokemon.prevo) {
const prevo = pokemonByName.get(pokemon.prevo)
for (const ability of Object.values(pokemon.abilities)) {
if (!hasAbility(ability, prevo.name)) {
if (!gainedAbilities[ability]) {
gainedAbilities[ability] = new Set([pokemon.name])
} else {
gainedAbilities[ability].add(pokemon.name)
}
}
}
}
}
return gainedAbilities
}