1
+ //Example of an else if statement
2
+ // change the value of `weather` to test your conditional statements
3
+ var weather = "snow" ;
4
+ if ( weather === "snow" ) {
5
+ console . log ( "Bring a coat." ) ;
6
+ } else if ( weather === "rain" ) {
7
+ console . log ( "Bring a rain jacket." ) ;
8
+ } else {
9
+ console . log ( "Wear what you have on." ) ;
10
+ }
11
+
12
+
13
+ //Example of an if else statement
14
+ var a = 1 ;
15
+ var b = 2 ;
16
+
17
+ if ( a > b ) {
18
+ console . log ( "a is greater than b" ) ;
19
+ } else {
20
+ console . log ( "a is less than or equal to b" ) ;
21
+ }
22
+
23
+ //Example of an else if statement
24
+ // change the value of `musicians` to test your conditional statements
25
+ var musicians = 1 ;
26
+
27
+ if ( musicians <= 0 ) {
28
+ console . log ( "not a group" ) ;
29
+ } else if ( musicians == - 1 ) {
30
+ console . log ( "not a group" ) ;
31
+ } else if ( musicians == 1 ) {
32
+ console . log ( "solo" ) ;
33
+ } else if ( musicians == 2 ) {
34
+ console . log ( "duet" ) ;
35
+ } else if ( musicians == 3 ) {
36
+ console . log ( "trio" ) ;
37
+ } else if ( musicians == 4 ) {
38
+ console . log ( "quartet" ) ;
39
+ } else {
40
+ console . log ( "this is a large group" ) ;
41
+ }
42
+
43
+
44
+ //Javascipt for making the topbanner of your page the same height of the device
45
+ //just change the '.topbanner' to the name of the class for your top banner or jumbotron.
46
+
47
+ < script >
48
+ $(window).resize(function() {
49
+ $ ( '.topbanner' ) . height ( $ ( window ) . height ( ) ) ;
50
+ } );
51
+
52
+ $(window).trigger('resize');
53
+ </ script >
0 commit comments