Skip to content

Commit f467e43

Browse files
BrianY315Copilot
andcommitted
Address review comments for paths and random exercises
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 440a54b commit f467e43

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

2020
const dir = filePath.slice(0, lastSlashIndex);
21-
const ext = filePath.slice(filePath.lastIndexOf(".") + 1);
21+
const ext = filePath.slice(filePath.lastIndexOf("."));
2222
console.log({ dir, ext });
2323

2424
// https://www.google.com/search?q=slice+mdn

‎Sprint-2/1-key-exercises/4-random.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)