File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
1010
1111console . log ( num ) ;
1212
13- //num is a random number between 1 and 100
13+ //num is a random number [1, 100]
1414//Math.floor rounds the decimal number to nearest lower number
1515// Math.random() generates a random decimal number between 0 and 1
1616// when max – min need to add +1 or not all the numbers will be
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ const last4Digits = cardNumber.slice(-4);
1515// const last4DigitsString = cardNumber.toString().slice(-4);
1616// or make it into a function that takes a number as an argument and returns the last 4 digits as a string
1717
18- function last4Digits ( cardNumber )
18+ function last4Digits ( cardNumber ) {
1919 return `${ cardNumber } ` . slice ( - 4 ) ;
20+ }
2021
2122console . log ( last4Digits ( cardNumber ) ) ;
You can’t perform that action at this time.
0 commit comments