File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,9 @@ 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-
19-
20- const dir = filePath . slice ( 0 , lastSlashIndex ) ; // The code uses the lastIndexOf method to find the position of the last slash in;
21- console . log ( `The dir part of ${ filePath } is ${ dir } ` ) ;
22- filePath . slice ( 0 , lastSlashIndex ) ;
23-
24- filePath
25- . slice ( lastSlashIndex + 1 )
26- . split ( "." )
27- . pop ( ) ;
2818// Create a variable to store the ext part of the variable
2919
30- const ext = base . slice ( base . lastIndexOf ( "." ) + 1 ) ; // The code uses the lastIndexOf method to find the position of the last dot in the base variable.
31- console . log ( `The ext part of ${ filePath } is ${ ext } ` ) ;
20+ const dir = ;
21+ const ext = ;
22+
23+ // https://www.google.com/search?q=slice+mdn
You can’t perform that action at this time.
0 commit comments