Skip to content

Commit 868b2f3

Browse files
committed
prettier
1 parent bb12ae4 commit 868b2f3

File tree

7 files changed

+8
-19
lines changed

7 files changed

+8
-19
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ let count = 0;
22

33
count = count + 1;
44

5-
6-
75
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
86
// Describe what line 3 is doing, in particular focus on what = is doing
97

108
/*Line 3 is reassigning variable count with a new value, in this case we're saying add 1 to whatever we already have in count,
119
and so by using the console.log before and after the reassignment the we can tell new value of count is 1
12-
*/
10+
*/

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ let 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-
98
// let initials = `${firstName.slice(0,1)}${middleName.slice(0,1)}${lastName.slice(0,1)}`; using slice on template literals
109

1110
//let initials = `${firstName.charAt(0)}${middleName.charAt(0)}${lastName.charAt(0)}`; using charAt on template literals
@@ -16,7 +15,9 @@ let lastName = "Johnson";
1615

1716
//let initials = [firstName, middleName, lastName].map(name => name.slice(0,1)).join('')
1817

19-
let initials = [firstName, middleName, lastName].map(name => name.charAt(0)).join('')
18+
let initials = [firstName, middleName, lastName]
19+
.map((name) => name.charAt(0))
20+
.join("");
2021

2122
/*
2223
There are more efficient ways of implementing the solution, however these concepts haven't been covered yet

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,11 @@ console.log(`The base part of ${filePath} is ${base}`);
1717
// Create a variable to store the dir part of the filePath variable
1818
const dir = filePath.slice(0, lastSlashIndex); // Extract the directory part (everything before the last slash)
1919

20-
21-
22-
2320
// Create a variable to store the ext part of the variable
2421
const lastDotIndex = base.lastIndexOf("."); // Find the index of the last dot in the base to get the extension
2522
const ext = lastDotIndex !== -1 ? base.slice(lastDotIndex) : ""; // Extract the extension (including the dot), or empty string if none
2623

27-
28-
29-
30-
3124
console.log(`The dir part of ${filePath} is ${dir}`);
3225
console.log(`The ext part of ${filePath} is ${ext}`);
3326

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

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

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ To avoid this, always declare and assign your variables before using them.
1010
*/
1111
const cityOfBirth = "Bolton";
1212
console.log(`I was born in ${cityOfBirth}`);
13-

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
99
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
1010

11-
12-
1311
/* This code throws an error because `cardNumber` is a **number**, and numbers do not have a `.slice()` method—`.slice()` is a method for strings and arrays.
1412
1513
**How to fix:**
@@ -24,4 +22,4 @@ Now, `last4Digits` will correctly contain the last 4 digits as a string.*/
2422

2523
const cardNumber = 4533787178994213;
2624
const last4Digits = cardNumber.toString().slice(-4);
27-
console.log(last4Digits);
25+
console.log(last4Digits);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
// variables in js can't begin with numbers
55
const twelveHourClockTime = "20:53";
6-
const twenty24hourClockTime = "08:53";
6+
const twenty24hourClockTime = "08:53";

0 commit comments

Comments
 (0)