Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Last active August 4, 2022 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NyaGarcia/395b235c4652d2c83229053f286a9f78 to your computer and use it in GitHub Desktop.
Save NyaGarcia/395b235c4652d2c83229053f286a9f78 to your computer and use it in GitHub Desktop.
function attackPokemon(enemyType: string) {
if (enemyType) {
if (enemyType === 'fire') {
useWaterAttack();
} else if (enemyType === 'grass') {
useFireAttack();
} else {
useGrassAttack();
}
} else {
console.log('You need to provide an enemy type');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment