Skip to content

Commit 896bdbc

Browse files
committed
Include dot in extracted file extension
1 parent c2d1d08 commit 896bdbc

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(filePath.lastIndexOf(".") + 1);
21+
const ext = filePath.slice(filePath.lastIndexOf("."));
2222

2323
console.log(`The directory of ${filePath} is ${dir}`);
2424
console.log(`The extension of ${filePath} is ${ext}`);

0 commit comments

Comments
 (0)