-
Notifications
You must be signed in to change notification settings - Fork 175
/
cleanUp.js
44 lines (31 loc) · 993 Bytes
/
cleanUp.js
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
// Each example below has at least one opportunity for improvement.
// YOUR TASK:
// Modify the code to make that improvement(s)
// write a JS comment to explain what you changed, and why
// make sure the code you submit WORKS - you can run this entire file
// using `node cleanUp.js` or copy and paste into a replit
// EX 1:
function askForName() { console.log("Hello, what is your name?") }
askForName()
// EX 2:
function addThreeNums(first, second, third) {
var sum = first + second + third
return sum;
}
addThreeNums(1, 2, 3);
addThreeNums(4, 2, 7);
// EX 3:
func makeFreshPesto(){
console.log("Buy ingredients: basil, parmesan, romano, olive oil, pine nuts, garlic, salt, pepper");
console.log("Pulse basil and pine nuts");
console.log("Add garlic and cheeses");
console.log("Slowly pour in oil");
console.log("Season"); }
makeFreshPesto();
// EX 4:
function average(num1, num2)
{
var sum = num1 + num2;
var avg = sum / 2;
return avg
}