File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ console.log(`The base part of ${filePath} is ${base}`);
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 ) ; // Creates a variable to store the dir part of the filePath variable
21+ const ext = base . slice ( base . lastIndexOf ( "." ) ) ; // Create a variable to store the ext part of the variable
22+ console . log ( `The dir part of ${ filePath } is ${ dir } ` ) ; // outputs "/Users/mitch/cyf/Module-JS1/week-1/interpret"
23+ console . log ( `The ext part of ${ filePath } is ${ ext } ` ) ; // outputs ".txt"
2224
23- // https://www.google.com/search?q=slice+mdn
25+ // https://www.google.com/search?q=slice+mdn
You can’t perform that action at this time.
0 commit comments