There was an error while loading. Please reload this page.
1 parent 42e81a7 commit bb1e2e0Copy full SHA for bb1e2e0
1 file changed
Sprint-2/1-key-exercises/3-paths.js
@@ -19,9 +19,10 @@ console.log(`The base part of ${filePath} is ${base}`);
19
20
21
22
-const dir = filePath.slice(base, -9);
23
-const ext = filePath.slice(-4);
+const dir = filePath.slice(0, lastSlashIndex);
+const ext = filePath.slice(filePath.lastIndexOf("."), filePath.length);
24
25
+console.log(dir)
26
console.log(ext)
27
28
// https://www.google.com/search?q=slice+mdn
0 commit comments