Skip to content

Commit c8fd52b

Browse files
committed
remove +1 from slice() to make the output include dot(.)
1 parent 9864337 commit c8fd52b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ const startDirIndex = filePath.lastIndexOf("Users");
2020
const dir = filePath.slice(startDirIndex , lastSlashIndex);
2121
console.log(`The dir part of ${filePath} is ${dir}`);
2222
const dotIndex = filePath.lastIndexOf(".");
23-
const ext = filePath.slice(dotIndex + 1);
23+
const ext = filePath.slice(dotIndex);
2424
console.log(`The ext part of the ${filePath} is ${ext}`);
2525

0 commit comments

Comments
 (0)