Skip to content

Commit b8ad3d3

Browse files
committed
modified: errors-and-debugging/exercises/Debugging1stSyntaxError.js
modified: errors-and-debugging/exercises/DebuggingLogicErrors5.js modified: errors-and-debugging/exercises/DebuggingRuntimeErrors1.js modified: errors-and-debugging/exercises/DebuggingRuntimeErrors2.js modified: errors-and-debugging/exercises/DebuggingSyntaxErrors2.js
1 parent 2c0fd93 commit b8ad3d3

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

errors-and-debugging/exercises/Debugging1stSyntaxError.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
let launchReady = false;
55
let fuelLevel = 17000;
66

7-
if (fuelLevel >= 20000 {
8-
console.log('Fuel level cleared.');
9-
launchReady = true;
7+
if (fuelLevel >= 20000) {
8+
console.log("Fuel level cleared.");
9+
launchReady = true;
1010
} else {
11-
console.log('WARNING: Insufficient fuel!');
12-
launchReady = false;
13-
}
11+
console.log("WARNING: Insufficient fuel!");
12+
launchReady = false;
13+
}

errors-and-debugging/exercises/DebuggingLogicErrors5.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Refactor the code to do this. Verify that your change works by updating the console.log statements.
44

55
let launchReady = false;
6+
let launchReady2 = false;
67
let fuelLevel = 17000;
78
let crewStatus = true;
89
let computerStatus = 'green';
@@ -19,10 +20,17 @@ console.log("launchReady = ", launchReady);
1920

2021
if (crewStatus && computerStatus === 'green'){
2122
console.log('Crew & computer cleared.');
22-
launchReady = true;
23+
launchReady2 = true;
2324
} else {
2425
console.log('WARNING: Crew or computer not ready!');
25-
launchReady = false;
26+
launchReady2 = false;
2627
}
2728

28-
console.log("launchReady = ", launchReady);
29+
console.log("launchReady2 = ", launchReady2);
30+
31+
if (launchReady && launchReady2) {
32+
console.log('10, 9, 8, 7, 6, 5, 4, 3, 2, 1...');
33+
console.log('Liftoff!');
34+
} else {
35+
console.log('Launch scrubbed.');
36+
}

errors-and-debugging/exercises/DebuggingRuntimeErrors1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
let launchReady = false;
55
let fuelLevel = 17000;
66

7-
if (fuellevel >= 20000) {
7+
if (fuelLevel >= 20000) {
88
console.log('Fuel level cleared.');
99
launchReady = true;
1010
} else {

errors-and-debugging/exercises/DebuggingRuntimeErrors2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (launchReady) {
1414
console.log("Fed parrot...");
1515
console.log("6, 5, 4...");
1616
console.log("Ignition...");
17-
consoul.log("3, 2, 1...");
17+
console.log("3, 2, 1...");
1818
console.log("Liftoff!");
1919
} else {
2020
console.log("Launch scrubbed.");

errors-and-debugging/exercises/DebuggingSyntaxErrors2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let launchReady = false;
88
let crewStatus = true;
99
let computerStatus = 'green';
1010

11-
if (crewStatus &&& computerStatus === 'green'){
11+
if (crewStatus && computerStatus === 'green'){
1212
console.log('Crew & computer cleared.');
1313
launchReady = true;
1414
} else {
@@ -17,7 +17,7 @@ if (crewStatus &&& computerStatus === 'green'){
1717
}
1818

1919
if (launchReady) {
20-
console.log(("10, 9, 8, 7, 6, 5, 4, 3, 2, 1...");
20+
console.log("10, 9, 8, 7, 6, 5, 4, 3, 2, 1...");
2121
console.log("Fed parrot...");
2222
console.log("Ignition...");
2323
console.log("Liftoff!");

0 commit comments

Comments
 (0)