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 d88693e commit ad07e16Copy full SHA for ad07e16
Sprint-1/1-key-exercises/3-paths.js
@@ -15,9 +15,14 @@ const base = filePath.slice(lastSlashIndex + 1);
15
console.log(`The base part of ${filePath} is ${base}`);
16
17
// Create a variable to store the dir part of the filePath variable
18
+const dir = filePath.slice(0, lastSlashIndex);
19
+
20
// Create a variable to store the ext part of the variable
21
+const lastDotIndex = filePath.lastIndexOf(".");
22
+const ext = filePath.slice(lastDotIndex);
23
24
+console.log(`The dir part of ${filePath} is ${dir}`);
25
+console.log(`The ext part of ${filePath} is ${ext}`);
26
-const dir = ;
-const ext = ;
27
-// https://www.google.com/search?q=slice+mdn
28
+// https://www.google.com/search?q=slice+mdn
0 commit comments