Skip to content

Commit

Permalink
fix: convert resetDisplay function to arrow function, reorder code
Browse files Browse the repository at this point in the history
  • Loading branch information
scissorsneedfoodtoo committed Nov 20, 2023
1 parent edd4277 commit a64c4d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions apps/pokemon-search-app/public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ const getPokemon = async () => {
}
};

searchForm.addEventListener('submit', e => {
e.preventDefault();
getPokemon();
});

function resetDisplay() {
const resetDisplay = () => {
// reset to default display if pokemon is not found

// reset image src and alt
Expand All @@ -75,4 +70,9 @@ function resetDisplay() {
specialAttack.innerHTML = '';
specialDefense.innerHTML = '';
speed.innerHTML = '';
}
};

searchForm.addEventListener('submit', e => {
e.preventDefault();
getPokemon();
});

0 comments on commit a64c4d3

Please sign in to comment.