-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.js
More file actions
56 lines (44 loc) · 901 Bytes
/
Copy pathfunc.js
File metadata and controls
56 lines (44 loc) · 901 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
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
/*function myFn(a, b) {
let c;
a = a + 1;
c = a + b;
return c;
}
myFn(10, 3);
console.log(myFn(10, 3));
console.log(myFn(41, 12));
function myFunction(a, b) {
console.log(a);
console.log(b);
}
myFunction();
console.log(myFunction());*/
//adding a return keyword
/*function sum(a, b){
return a + b;
}
sum(10, 13);
console.log(sum(10, 15)); //25
console.log(sum("abc", 2)); //string abc2
console.log(sum()); //NaN*/
/* //Challenge 1
function mult(a, b, c) {
let result;
result = a * b * c;
console.log(result);
}
mult(2, 2, 4); */
/*//Challenge 2
function concatenateStrings(a, b) {
return a + b;
}
console.log(concatenateStrings("Hello", " World")); */
//Challenge 3
function outerFunction(a, b) {
function innerFunction(c) {
return c * c;
}
const sum = a + b;
const result = innerFunction(sum);
console.log(result);
}