Skip to content

Commit 48ef768

Browse files
committed
answer 3 - paths
1 parent 734265f commit 48ef768

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ 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+
//console.log(lastSlashIndex);
20+
console.log(base);
1921

2022
const dir = filePath.slice(0, lastSlashIndex);
2123
const ext = base.slice(base.lastIndexOf("."));
24+
console.log(`The extension part of directory ${dir} is ${ext}`);
25+
2226

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

0 commit comments

Comments
 (0)