/*
• Alien Colors #2: Choose a color for an alien as you did in Exercise 25, and write an if-else chain.
o If the alien’s color is green, print a statement that the player just earned 5 points for shooting the alien.
o If the alien’s color isn’t green, print a statement that the player just earned 10 points.
o Write one version of this program that runs the if block and another that runs the else block.
*/
let alien_color: string = 'green';
if (alien_color === 'green') {
console.log("Player just earned 5 points for shooting the alien");
} else {
console.log("Player just earned 10 points");
}
To embed this project on your website, copy the following code and paste it into your website's HTML: