Skip to content

Commit cbac6c9

Browse files
committed
initial message
1 parent 4c2c13b commit cbac6c9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ let count = 0;
33
count = count + 1;
44

55
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
6-
// Describe what line 3 is doing, in particular focus on what = is doing
6+
// Describe what line 3 is doing, in particular what=
7+
Line one shows the initial value is 0 as a variable Declaration,
8+
Line 3 on the right-hand side count + 1 is evaluated first which means the current value 0 adds 1, giving 1
9+
The left-hand side count= means: Assign the result of right-hand side 1 back into the variable
10+
count. So after this runs the output should be 1

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ 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-
let initials = ``;
8+
let initials = firstName[0]+middleName[0]+lastName[0];
99

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

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ console.log(`The base part of ${filePath} is ${base}`);
1616

1717
// Create a variable to store the dir part of the filePath variable
1818
// Create a variable to store the ext part of the variable
19+
// Get everthing before base
20+
const dir = filePath.slice(0,lastSlashIndex);
1921

20-
const dir = ;
22+
//Get everything after the last dot in the base
23+
const lastDotIndex = base.lastIndexOf(".")
2124
const ext = ;
2225

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

0 commit comments

Comments
 (0)