Skip to content

Commit fca74e9

Browse files
assigned values to variables dir and ext (3-paths.js)
Utilized prettier to format code in (1-count.js; 2-initials.js; 3-paths.js)
1 parent 683ae71 commit fca74e9

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ console.log(count);
77
// Describe what line 3 is doing, in particular focus on what = is doing
88

99
// Line 3 is reassigning the value of the count variable to the result of the expression count + 1.
10-
// The = operator is the assignment operator, which assigns the value on the right-hand side
11-
// (the result of count + 1) to the variable on the left-hand side (count).
12-
// This increments the value of count by 1.
10+
// The = operator is the assignment operator, which assigns the value on the right-hand side
11+
// (the result of count + 1) to the variable on the left-hand side (count).
12+
// This increments the value of count by 1.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ let initials = `${firstName[0]}${middleName[0]}${lastName[0]}`;
1010
console.log(initials);
1111

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

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ console.log(`The base part of ${filePath} is ${base}`);
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
1919

20-
const dir = ;
21-
const ext = ;
20+
const dir = filePath.slice(0, lastSlashIndex);
21+
console.log(`the dir part of ${filePath} is ${dir}`);
2222

23-
// https://www.google.com/search?q=slice+mdn
23+
const ext = filePath.slice(filePath.lastIndexOf("."));
24+
console.log(`the ext part of ${filePath} is ${ext}`);
25+
26+
// https://www.google.com/search?q=slice+mdn

0 commit comments

Comments
 (0)