Skip to content

Commit e6e1610

Browse files
committed
added ext print function
1 parent 868d352 commit e6e1610

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ console.log(`The base part of ${filePath} is ${base}`);
1919

2020
const dir = filePath.slice(0,lastSlashIndex);
2121
console.log(dir);
22-
const LastDotIndex = base.lastIndexOf(".");
23-
const ext = base.slice("/");
22+
const lastDotIndex = base.lastIndexOf(".");
23+
const ext = base.slice("lastDotIndex + 1");
24+
console.log(ext);
2425

25-
// https://www.google.com/search?q=slice+mdn
26+
// https://www.google.com/search?q=slice+mdn

0 commit comments

Comments
 (0)