-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq26.js
More file actions
17 lines (17 loc) · 761 Bytes
/
q26.js
File metadata and controls
17 lines (17 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"use strict";
// Alien Colors #2: Choose a color for an alien as you did in Exercise 25, and write an if-else chain.
exports.__esModule = true;
// • If the alien’s color is green, print a statement that the player just earned 5 points for shooting the alien.
// • If the alien’s color isn’t green, print a statement that the player just earned 10 points.
// • Write one version of this program that runs the if block and another that runs the else block.
function q26() {
var alien_color = 'yellow';
if (alien_color === 'green') {
console.log("Congratulations! You just earned 5 points!");
}
else {
console.log("Congratulations! You just earned 10 points!");
}
}
exports["default"] = q26;
q26();