File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
2020const dir = filePath . slice ( 0 , lastSlashIndex ) ;
21- const ext = filePath . slice ( filePath . lastIndexOf ( "." ) + 1 ) ;
21+ const ext = filePath . slice ( filePath . lastIndexOf ( "." ) ) ;
2222console . log ( { dir, ext } ) ;
2323
2424// https://www.google.com/search?q=slice+mdn
Original file line number Diff line number Diff line change @@ -8,3 +8,6 @@ console.log(num);
88// Try breaking down the expression and using documentation to explain what it means
99// It will help to think about the order in which expressions are evaluated
1010// Try logging the value of num and running the program several times to build an idea of what the program is doing
11+ // Math.random() generates a decimal from 0 up to, but not including, 1.
12+ // Multiplying by (maximum - minimum + 1) scales the range to 100 possible values.
13+ // Math.floor() removes the decimal, and adding minimum shifts the result to an integer from 1 to 100.
You can’t perform that action at this time.
0 commit comments