Skip to content

Commit 0a6358a

Browse files
author
russom
committed
Change to robust slice method
1 parent 5a857cf commit 0a6358a

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
@@ -18,7 +18,7 @@ console.log(`The base part of ${filePath} is ${base}`);
1818
// Create a variable to store the ext part of the variable
1919

2020
const dir = filePath.slice(0, lastSlashIndex);
21-
const ext = filePath.slice(-3);
21+
const ext = filePath.slice(filePath.length -3);
2222

2323
console.log(dir);
2424
console.log(ext);

0 commit comments

Comments
 (0)