Skip to content

Commit 23673ee

Browse files
Fix: update in 3-paths.js
1 parent bb34ab4 commit 23673ee

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const base = filePath.slice(lastSlashIndex + 1);
1515
console.log(`The base part of ${filePath} is ${base}`);
1616

1717
// Create a variable to store the dir part of the filePath variable
18-
const dir = filePath.slice(0, lastSlashIndex + 1);
18+
const dir = filePath.slice(0, lastSlashIndex);
1919

2020
// Create a variable to store the ext part of the variable
2121
const lastDotIndex = filePath.lastIndexOf(".");
22-
const ext = filePath.slice(lastDotIndex + 1);
22+
const ext = filePath.slice(lastDotIndex);
2323

24-
// console.log(dir);
25-
// console.log(ext);
24+
console.log(`The dir part of ${filePath} is ${dir}`);
25+
console.log(`The ext part of ${filePath} is ${ext}`);
2626

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

0 commit comments

Comments
 (0)