File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,13 +15,13 @@ const base = filePath.slice(lastSlashIndex + 1);
1515console . log ( `The base part of ${ filePath } is ${ base } ` ) ;
1616
1717// Create a variable to store the dir part of the filePath variable
18- const dir = filePath . slice ( 0 , lastSlashIndex + 1 ) ;
18+ const dir = filePath . slice ( 0 , lastSlashIndex ) ;
1919
2020// Create a variable to store the ext part of the variable
2121const lastDotIndex = filePath . lastIndexOf ( "." ) ;
22- const ext = filePath . slice ( lastDotIndex + 1 ) ;
22+ const ext = filePath . slice ( lastDotIndex ) ;
2323
24- // console.log(dir);
25- // console.log(ext);
24+ console . log ( `The dir part of ${ filePath } is ${ dir } ` ) ;
25+ console . log ( `The ext part of ${ filePath } is ${ ext } ` ) ;
2626
27- // https://www.google.com/search?q=slice+mdn
27+ // https://www.google.com/search?q=slice+mdn
You can’t perform that action at this time.
0 commit comments