Skip to content

Commit 71349b9

Browse files
committed
I Fixed the code to get parts of filePath; runs correctly
1 parent 634a2d8 commit 71349b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ console.log(`The base part of ${filePath} is ${base}`);
1818
// Create a variable to store the ext part of the variable
1919

2020
const dir = filePath.slice(0,lastSlashIndex);
21-
const ext = filePath.slice(dotIndex)
21+
const ext = base.slice(base.lastIndexOf("."));
22+
23+
24+
console.log(filePath, dir);
25+
console.log(filePath, ext);
26+
2227

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

0 commit comments

Comments
 (0)