Skip to content

Commit 5ec9103

Browse files
Format Sprint 2 with Prettier
1 parent 02966a9 commit 5ec9103

15 files changed

Lines changed: 18 additions & 23 deletions

File tree

‎Sprint-2/1-key-exercises/1-count.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ count = count + 1;
66
// Describe what line 3 is doing, in particular focus on what = is doing
77

88
// Line 3: Adds 1 to count and assigns the result back to count.
9-
// The = operator assigns the new value to count.
9+
// The = operator assigns the new value to count.

‎Sprint-2/1-key-exercises/2-initials.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const lastName = "Johnson";
55
// Declare a variable called initials that stores the first character of each string.
66
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.
77

8-
const initials = (firstName[0] + middleName[0]+ lastName[0]);
8+
const initials = firstName[0] + middleName[0] + lastName[0];
99
console.log(initials);
1010

1111
// https://www.google.com/search?q=get+first+character+of+string+mdn

‎Sprint-2/1-key-exercises/3-paths.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ console.log(`The base part of ${filePath} is ${base}`);
2020
const dir = filePath.slice(0, lastSlashIndex);
2121
const ext = filePath.slice(filePath.lastIndexOf("."));
2222

23-
// https://www.google.com/search?q=slice+mdn
23+
// https://www.google.com/search?q=slice+mdn

‎Sprint-2/1-key-exercises/4-random.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ console.log(num);
1010
// Try logging the value of num and running the program several times to build an idea of what the program is doing
1111

1212
// Math.floor() rounds down to a whole number instead of rounding up
13-
// Math.random() gives a random decimal
13+
// Math.random() gives a random decimal
1414

1515
//num represents a random whole number between 1 and 100.

‎Sprint-2/2-mandatory-errors/0.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//This is just an instruction for the first activity - but it is just for human consumption
2-
//We don't want the computer to run these 2 lines - how can we solve this problem?
2+
//We don't want the computer to run these 2 lines - how can we solve this problem?

‎Sprint-2/2-mandatory-errors/1.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ console.log(age);
66

77
// Error: TypeError
88
// Why: Assignment to constant variable.
9-
// Fix: Changed const to let, which allows the variable to be reassigned.
9+
// Fix: Changed const to let, which allows the variable to be reassigned.

‎Sprint-2/2-mandatory-errors/2.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
const cityOfBirth = "Bolton";
55
console.log(`I was born in ${cityOfBirth}`);
66

7-
8-
// Error: ReferenceError:
7+
// Error: ReferenceError:
98
// Why: Cannot access 'cityOfBirth' before initialization
10-
// Fix: Declare the const before using it
9+
// Fix: Declare the const before using it

‎Sprint-2/2-mandatory-errors/3.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ console.log(last4Digits);
99
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
1010
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
1111

12-
1312
// Prediction: TypeError
1413
// Why: cardNumber is a number, but slice() is a string method.
1514

1615
// Actual error: TypeError: cardNumber.slice is not a function
1716
// The prediction was correct.
1817

19-
// Fix: convert cardNumber to a string before using slice.
18+
// Fix: convert cardNumber to a string before using slice.

‎Sprint-2/2-mandatory-errors/4.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ const hour24ClockTime = "20:53";
33
console.log(Hour12ClockTime + " " + hour24ClockTime);
44

55
// Error: SyntaxError: Invalid or unexpected token
6-
// Why: A JavaScript variable name cannot start with a number.
6+
// Why: A JavaScript variable name cannot start with a number.

‎Sprint-2/3-mandatory-interpret/1-percentage-change.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ console.log(`The percentage change is ${percentageChange}`);
2727
// Fix: Add the missing comma:
2828
// priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));
2929

30-
3130
// c) Identify all the lines that are variable reassignment statements
3231

3332
// carPrice = Number(carPrice.replaceAll(",", ""));
@@ -42,4 +41,4 @@ console.log(`The percentage change is ${percentageChange}`);
4241

4342
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
4443

45-
// It removes the comma from the string and converts the resulting string into a number.
44+
// It removes the comma from the string and converts the resulting string into a number.

0 commit comments

Comments
 (0)