Skip to content

Commit 45fdc2a

Browse files
committed
adding values to the var dir & var ext
1 parent e736c01 commit 45fdc2a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
const filePath = "/Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt";
1313
const lastSlashIndex = filePath.lastIndexOf("/");
1414
const base = filePath.slice(lastSlashIndex + 1);
15-
console.log(`The base part of ${filePath} is ${base}`);
15+
//console.log(`The base part of ${filePath} is ${base}`);
1616

1717
// Create a variable to store the dir part of the filePath variable
1818
// Create a variable to store the ext part of the variable
1919

20-
const dir = ;
21-
const ext = ;
20+
const dir = filePath.slice(0, lastSlashIndex);
21+
const ext = base.slice(-4);
22+
//console.log(dir);
23+
//console.log(ext);
2224

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

0 commit comments

Comments
 (0)