File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ console.log(base); // file.txt
2828const lastDotIndex = filePath . lastIndexOf ( "." ) ;
2929console . log ( lastDotIndex ) ; // index position 49
3030const extractDir = filePath . slice ( 0 , lastDotIndex ) ;
31- console . log ( `Directory and filename (without extension) ${ extractDir } ` ) ;
31+ console . log ( `Directory and filename (without extension) is: ${ extractDir } ` ) ;
3232
3333
3434// Create a variable to store the ext part of the variable"
Original file line number Diff line number Diff line change 11const minimum = 1 ;
22const maximum = 100 ;
33
4- const num = Math . floor ( Math . random ( ) * ( maximum - minimum + 1 ) ) + minimum ;
4+ // const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
5+ // console.log(num);
6+
7+
8+ // Math.floor() takes the integer Number
9+ // Math.random() will take a number between 1-100;
10+
11+
512
613// In this exercise, you will need to work out what num represents?
714// Try breaking down the expression and using documentation to explain what it means
815// It will help to think about the order in which expressions are evaluated
916// Try logging the value of num and running the program several times to build an idea of what the program is doing
17+
18+
19+
20+ function getRandomArbitrary ( min , max ) {
21+ return Math . random ( ) * ( max - min ) + min ;
22+ }
23+
24+ console . log ( getRandomArbitrary ( minimum , maximum ) ) ;
You can’t perform that action at this time.
0 commit comments