We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 095a3ea commit 1030764Copy full SHA for 1030764
Sprint-1/1-key-exercises/3-paths.js
@@ -20,7 +20,9 @@ console.log(`The base part of ${filePath} is ${base}`);
20
21
const dir = filePath.slice(0,lastSlashIndex) ;
22
console.log(dir);
23
-const ext = filePath.slice(lastSlashIndex + 1) ;
+const lastDotIndex = base.lastIndexOf(".");
24
+console.log(lastDotIndex);
25
+const ext = base.slice(lastDotIndex) ;
26
console.log(ext);
27
28
// https://www.google.com/search?q=slice+mdn
0 commit comments