File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ count = count + 1;
55// Line 1 is a variable declaration, creating the count variable with an initial value of 0
66// Describe what line 3 is doing, in particular focus on what = is doing
77
8- = mean assignment operator . Computer will calculate the result of "count + 1" and update the variable with the result .
9- In this question , variable "count" changed from 0 to 1.
8+ // = mean assignment operator. Computer will calculate the result of "count + 1" and update the variable with the result.
9+ // In this question, variable "count" changed from 0 to 1.
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- math . floor is round down the number returns to largest integer less than or equal to a given number .
14- math . random ( ) could generate the number from 0 to < 1 b random .
15- maximum refer to 100 and minimum refer to 0.
16- The calculation of num is different everytime because of math . random ( )
13+ // math.floor is round down the number returns to largest integer less than or equal to a given number.
14+ // math.random() could generate the number from 0 to <1 b random.
15+ // maximum refer to 100 and minimum refer to 0.
16+ // The calculation of num is different everytime because of math.random()
Original file line number Diff line number Diff line change 11This is just an instruction for the first activity - but it is just for human consumption
22We don 't want the computer to run these 2 lines - how can we solve this problem?
33
4- adding // before the lines.
4+ // adding // before the lines.
Original file line number Diff line number Diff line change 11// trying to create an age variable and then reassign the value by 1
22
3- const age = 33 ;
3+ let age = 33 ;
44age = age + 1 ;
55
66console . log ( age )
77
8- The error is "Assignment to constant variable." Constant value could not be alternated .
9- if line 3 const changed to let the code could be executed .
8+ // The error is "Assignment to constant variable." Constant value could not be alternated.
9+ // if line 3 const changed to let the code could be executed.
Original file line number Diff line number Diff line change 11// Currently trying to print the string "I was born in Bolton" but it isn't working...
22// what's the error ?
33
4- console . log ( `I was born in ${ cityOfBirth } ` ) ;
54const cityOfBirth = "Bolton" ;
5+ console . log ( `I was born in ${ cityOfBirth } ` ) ;
6+
67
7- Initialization should access before the declaration .
8+ // Initialization should access before the declaration.
Original file line number Diff line number Diff line change 1- const cardNumber = 4533787178994213 ;
1+ const cardNumber = ' 4533787178994213' ;
22const last4Digits = cardNumber . slice ( - 4 ) ;
33
4+ console . log ( last4Digits )
5+
46// The last4Digits variable should store the last 4 digits of cardNumber
57// However, the code isn't working
68// Before running the code, make and explain a prediction about why the code won't work
79// Then run the code and see what error it gives.
810// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
911// Then try updating the expression last4Digits is assigned to, in order to get the correct value
1012
11- slice is for text or array only . Need to change card number from number to text . Add ''for 4533787178994213.
13+ // slice is for text or array only. Need to change card number from number to text. Add ''for 4533787178994213.
Original file line number Diff line number Diff line change 11const twelveHourClockTime = "8:53pm" ;
22const twentyFourHourClockTime = "20:53" ;
33
4- //integer/ number could not start for the initiation.
4+ //integer and number could not start for the initiation.
You can’t perform that action at this time.
0 commit comments