File tree Expand file tree Collapse file tree 6 files changed +28
-8
lines changed
Expand file tree Collapse file tree 6 files changed +28
-8
lines changed Original file line number Diff line number Diff line change 11let count = 0 ;
2-
32count = count + 1 ;
43
54// Line 1 is a variable declaration, creating the count variable with an initial value of 0
Original file line number Diff line number Diff line change 1- This is just an instruction for the first activity - but it is just for human consumption
2- We don 't want the computer to run these 2 lines - how can we solve this problem?
1+ //This is just an instruction for the first activity - but it is just for human consumption
2+ //We don't want the computer to run these 2 lines - how can we solve this problem?
3+
4+ //Answer:
5+
6+ //By turning them into comments(by using //) just like this setence.
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 ;
5+
6+ console . log ( age ) ;
7+
8+
9+ //I had to change the variable (conts) to (let) because a value assigned to (conts) can not be assign again, while with (let) it can be reassigned
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+
7+ //It is important to declare a variable before using it.
Original file line number Diff line number Diff line change 1- const cardNumber = 4533787178994213 ;
1+ const cardNumber = " 4533787178994213" ;
22const last4Digits = cardNumber . slice ( - 4 ) ;
33
44// The last4Digits variable should store the last 4 digits of cardNumber
@@ -7,3 +7,8 @@ const last4Digits = cardNumber.slice(-4);
77// Then run the code and see what error it gives.
88// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
99// Then try updating the expression last4Digits is assigned to, in order to get the correct value
10+
11+ console . log ( last4Digits )
12+
13+
14+ //The number attributed to the value cardNumber is not a String, so we need to make the make a string.
Original file line number Diff line number Diff line change 1- const 12 HourClockTime = "20:53" ;
2- const 24 hourClockTime = "08:53" ;
1+ const formatAs12HourClockTime = "20:53" ;
2+ const formatAs24hourClockTime = "08:53" ;
3+
4+ console . log ( formatAs12HourClockTime )
5+ console . log ( formatAs24hourClockTime )
6+
7+ //Variable names do not start with numbers.
You can’t perform that action at this time.
0 commit comments