Skip to content

Commit 65b8d4b

Browse files
authored
Update 3-paths.js
1 parent a4dbb5a commit 65b8d4b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +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-
19+
const lastDotIndex = filePath.lastIndexOf(".");
2020
const dir = filePath.slice(0, lastSlashIndex);
21-
console.log(`The dir part of ${filePath} is ${dir}`);
22-
2321
const ext = filePath.slice(lastDotIndex + 1);
24-
console.log(`The ext part of ${filePath} is ${ext}`);
22+
console.log(dir);
23+
console.log(ext);
2524

2625

2726

0 commit comments

Comments
 (0)