Interview question of the issue #319 of rendezvous with cassidoo.
Using the PokéAPI (or your own local setup) write a function that takes in a Pokémon type, and returns what that type is weak against, and strong against. Here is the listing of types and here's an example JSON for the fighting
type!
Example:
> typeMatchup('fighting')
> "Weak against flying, psychic, and fairy. Strong against normal, rock, steel, ice, and dark."
> typeMatchup('cassidy')
> "This is not a valid Pokémon type, she's weak against everything."
// You can put whatever you want in this response, heh.
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!