File tree Expand file tree Collapse file tree 1 file changed +1
-53
lines changed
Expand file tree Collapse file tree 1 file changed +1
-53
lines changed Original file line number Diff line number Diff line change 1818</ head >
1919
2020< body >
21- < script >
22- function compare ( a , b ) {
23- if ( isNaN ( a ) ) {
24- console . log ( 'a is not a number' ) ;
25- } else if ( isNaN ( b ) ) {
26- console . log ( 'b is not a number' ) ;
27- } else if ( a < b ) {
28- console . log ( 'a is less than b' ) ;
29- } else if ( a == b ) {
30- console . log ( 'a equals b' ) ;
31- } else {
32- console . log ( 'a is greater than b' ) ;
33- }
34- }
35-
36- function weekend ( ) {
37- const day = new Date ( ) . getDay ( ) ;
38-
39- return ( day == 0 || day == 6 ) ? "It's the weekend" : "It's not the weekend" ;
40- }
41-
42- function today ( ) {
43- const day = new Date ( ) . getDay ( ) ;
44-
45- switch ( day ) {
46- case 0 :
47- console . log ( 'Today is Sunday' ) ;
48- break ;
49- case 1 :
50- console . log ( 'Today is Monday' ) ;
51- break ;
52- case 2 :
53- console . log ( 'Today is Tuesday' ) ;
54- break ;
55- case 3 :
56- console . log ( 'Today is Wednesday' ) ;
57- break ;
58- case 4 :
59- console . log ( 'Today is Thursday' ) ;
60- break ;
61- case 5 :
62- console . log ( 'Today is Friday' ) ;
63- break ;
64- case 6 :
65- console . log ( 'Today is Saturday' ) ;
66- break ;
67- default :
68- console . log ( 'getDay returned value out of range' ) ;
69- break ;
70-
71- }
72- }
73- </ script >
21+
7422</ body >
7523
7624</ html >
You can’t perform that action at this time.
0 commit comments