Skip to content

Commit 03bde13

Browse files
committed
making changes per review
1 parent 20eeeea commit 03bde13

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

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

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

88
//line 3: we are re-assigning count using the assignment operator (=). The " = " is used in JavaScript to assing a value
9-
// to a variable and in this case we are re-assinging count to equal count + 1.
9+
// to a variable and in this case we are re-assinging count to equal count + 1.
10+
// we are incrementing count

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,22 @@ console.log(`The base part of ${filePath} is ${base}`);
1717

1818
// Create a variable to store the dir part of the filePath variable
1919
// Create a variable to store the ext part of the variable
20+
const firstSlash = filePath.indexOf("/");
21+
const period = filePath.indexOf(".");
22+
const secondSlash = filePath.indexOf("/", firstSlash + 1);
23+
const thirdSlash = filePath.indexOf("/", secondSlash + 1);
24+
const fourthSlash = filePath.indexOf("/", thirdSlash + 1);
25+
const fifthSlash = filePath.indexOf("/", fourthSlash + 1);
26+
const sixthSlash = filePath.indexOf("/", fifthSlash + 1);
27+
const seventhSlash = filePath.indexOf("/", sixthSlash + 1);
28+
const eighthSlash = filePath.indexOf("/", seventhSlash + 1);
2029

21-
const dir = filePath.slice(1 , 44);
30+
31+
32+
33+
const dir = filePath.slice(firstSlash , seventhSlash + 1);
2234
console.log(dir)
23-
const ext = filePath.slice(lastSlashIndex + 5 );
35+
const ext = filePath.slice(period);
2436
console.log(ext)
2537

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

0 commit comments

Comments
 (0)