BhavyaCodes / pokemon

https://pokemon-hacktoberfest.vercel.app
15 stars 40 forks source link

Refactor code for Pokemon type #13

Closed bhavin-a closed 3 years ago

bhavin-a commented 3 years ago

Hi @Juggernaut9

Currently, to match Pokemon type, we are using a function and branching it with if else statements. Instead of branching, I think we can use a constant with an idea of utilising it as a hashmap. Much lesser cognitive complexity and easier to maintain :).

Please let me know if you find this ok. I can do a small tweak with the code. Thanks!

BhavyaCodes commented 3 years ago

yes please go ahead!

bhavin-a commented 3 years ago

Cool! Can you please assign it to me as well? Thanks again

secretshardul commented 3 years ago

Done. @Juggernaut9 check out my PR #26