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 @@ -7,3 +7,5 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
77// Try breaking down the expression and using documentation to explain what it means
88// It will help to think about the order in which expressions are evaluated
99// Try logging the value of num and running the program several times to build an idea of what the program is doing
10+
11+ console . log ( num )
Original file line number Diff line number Diff line change 1+ const password = "secretword123" ;
2+ const userInput = "thisiswrong" ;
3+ const adminPassword = "override" ;
4+ let response = "" ;
5+
6+ if ( userInput === password ) {
7+ response = "Correct password entered" ;
8+ } else if ( userInput === adminPassword ) {
9+ response = "Admin access granted" ;
10+ } else {
11+ response = "Incorrect password!" ;
12+ }
13+
14+ console . log ( response ) ;
Original file line number Diff line number Diff line change 1+ console . log ( 42 === 42 ) ;
Original file line number Diff line number Diff line change 1+ const password = "secretword123" ;
2+ const userInput = "thisiswrong" ;
3+ const adminPassword = "override" ;
4+ const response = "" ;
5+
6+ if ( userInput === password ) {
7+ response = "Correct password entered" ;
8+ } else if ( userInput === adminPassword ) {
9+ response = "Admin access granted" ;
10+ } else {
11+ response = "Incorrect password!" ;
12+ }
13+
14+ console . log ( response ) ;
Original file line number Diff line number Diff line change 1+ console . log ( "I am from Hong Kong." ) ;
Original file line number Diff line number Diff line change 1+
2+ const name = "Roger!" ;
3+ let greeting = "hello!" ;
4+ greeting = "Goodbye!"
5+ console . log ( `${ greeting } , ${ name } ` ) ;
Original file line number Diff line number Diff line change 1+ console . log ( "oh my god1" )
You can’t perform that action at this time.
0 commit comments