File tree 2 files changed +34
-1
lines changed
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "liveServer.settings.port" : 5501
3
+ }
Original file line number Diff line number Diff line change 1
1
// Iteration 1: Names and Input
2
-
2
+ const hacker1 = "Gregory" ;
3
+ console . log ( `The driver's name is ${ hacker1 } ` ) ;
4
+ const hacker2 = "Jennifer" ;
5
+ console . log ( `The navigator's name is ${ hacker2 } ` ) ;
3
6
4
7
// Iteration 2: Conditionals
5
8
9
+ if ( hacker1 . length > hacker2 . length ) {
10
+ console . log ( `The driver has the longest name, it has ${ hacker1 . length } characters` ) ;
11
+ } else if ( hacker1 . length < hacker2 . length ) {
12
+ console . log ( `It seems that the navigator has the longest name, it has ${ hacker2 . length } characters.` )
13
+ } else {
14
+ console . log ( `Wow, you both have equally long names, ${ hacker1 . length || hacker2 . length } characters!` )
15
+ }
6
16
7
17
// Iteration 3: Loops
18
+
19
+ const updatedHackerName1 = hacker1 . split ( '' ) . join ( ' ' ) . toUpperCase ( ) ;
20
+ console . log ( updatedHackerName1 ) ;
21
+
22
+ for ( let i = hacker2 . length - 1 ; i >= 0 ; i -- ) {
23
+ console . log ( hacker2 [ i ] ) ;
24
+ }
25
+
26
+
27
+ if ( hacker1 [ 0 ] > hacker2 [ 0 ] ) {
28
+ console . log ( "The driver's name goes first." ) ;
29
+ } else if ( hacker1 [ 0 ] < hacker2 [ 0 ] ) {
30
+ console . log ( "Yo, the navigator goes first, definitely." )
31
+ } else {
32
+ console . log ( "What?! You both have the same name?" )
33
+ }
34
+
35
+ // BONUS 2
36
+
37
+
You can’t perform that action at this time.
0 commit comments