-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrilling.js
More file actions
30 lines (27 loc) · 836 Bytes
/
grilling.js
File metadata and controls
30 lines (27 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function xmas(){
var today=new Date();
var cmas=new Date(today.getFullYear(), 11, 25);
if (today.getMonth()==11 && today.getDate()>25)
{
cmas.setFullYear(cmas.getFullYear()+1);
}
var one_day=1000*60*60*24;
console.log(Math.ceil((cmas.getTime() - today.getTime()) / (one_day)) + ' days left until Christmas');
}
xmas ();
var visitor = function (){
var favColor = prompt('What is your favorite color?');
var response;
if (favColor = 'blue') {
response = 'Good choice! Mine, too.';
} else if (favColor = 'orange') {
response = 'That is a fruit, not a color.';
} else if (favColor = 'yellow') {
response = 'Mm. Tastes like sunshine.';
} else {
response = 'All colors are awesome!';
}
return '<h3>' + response + '<h3>'
console.log(response);
}
visitor ();