-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.txt
More file actions
63 lines (50 loc) · 1.36 KB
/
Functions.txt
File metadata and controls
63 lines (50 loc) · 1.36 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
function getReminder(){
console.log('Water the plants.');
}
function greetInSpanish(){
console.log('Buenas Tardes.');
}
function sayThanks(){
console.log('Thank you for your purchase! We appreciate your business.');
}
sayThanks();
sayThanks();
sayThanks();
function sayThanks(name) {
console.log('Thank you for your purchase ' + name + '! We appreciate your business.');
}
sayThanks('Cole');
function makeShoppingList(item1 = 'milk', item2 = 'bread', item3 = 'eggs'){
console.log(`Remember to buy ${item1}`);
console.log(`Remember to buy ${item2}`);
console.log(`Remember to buy ${item3}`);
}
function monitorCount(rows, columns) {
return rows * columns;
}
const numOfMonitors = monitorCount(5, 4);
console.log(numOfMonitors);
function monitorCount(rows, columns) {
return rows * columns;
}
function costOfMonitors(rows, columns){
return monitorCount(rows, columns) * 200;
}
const totalCost = costOfMonitors(5, 4);
console.log(totalCost);
const plantNeedsWater = function anonymous(day){
if (day === 'Wednesday'){
return true;
} else {
return false;
}
}
console.log(plantNeedsWater('Tuesday'));
const plantNeedsWater = (day) => {
if (day === 'Wednesday') {
return true;
} else {
return false;
}
};
const plantNeedsWater = day => day === 'Wednesday' ? true : false;