Skip to content

Commit 7c792ee

Browse files
committed
updated code on line 18
1 parent 9a8d497 commit 7c792ee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
const filePath = "/Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt";
1313
const lastSlashIndex = filePath.lastIndexOf("/"); //44
1414
const base = filePath.slice(lastSlashIndex + 1); //file.txt
15-
console.log(`The base part of ${filePath} is ${base}`);
15+
//console.log(`The base part of ${filePath} is ${base}`);
1616

1717
const dir = filePath.slice(0, lastSlashIndex);
18-
const ext = base.slice(4);
18+
const ext = filePath.slice(-4);
1919
console.log(dir);
2020
console.log(ext);
2121
// https://www.google.com/search?q=slice+mdn

0 commit comments

Comments
 (0)