-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay5.js
More file actions
96 lines (84 loc) · 1.31 KB
/
Copy pathDay5.js
File metadata and controls
96 lines (84 loc) · 1.31 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//Activty 1
let a = 223424;
function even(a) {
if (a % 2 == 0) {
console.log("even");
} else {
console.log("odd");
}
}
even(a);
function sqr(a) {
let sqr = a ** 2;
console.log(sqr);
}
sqr(a);
//Activity 2
let b = 24;
function max(a, b) {
if (a > b) {
console.log("a is max", a);
} else {
console.log("b is max", b);
}
}
max(a, b);
let str1 = "mrigaank ",
str2 = "sharma";
function concate(str1, str2) {
let str = str1 + str2;
console.log(str);
}
concate(str1, str2);
//Activity 3
const sum = (a, b) => {
sum1 = a + b;
console.log(sum1);
};
sum(a, b);
const check = (str1) => {
if (str1.includes("k")) {
console.log(true);
} else {
console.log(false);
}
};
check(str1);
//Activity 4
let i = 24;
function prod(i, l = 2) {
let produ = i * l;
console.log(produ);
}
prod(i);
let nm = "mrigaank";
function greeting(nm, age = 20) {
console.log(`Hi, ${nm} is your age is ${age} ?,its nice`);
}
greeting(nm);
//Activity 5
let j=3;
function funck(j) {
console.log("hello");
}
function call(func, j) {
for (let index = 1; index <= j; index++) {
funck(j);
}
}
call(funck(j), j);
//task10
function two(f1,f2,z) {
v=f1(z)
w=f2(v)
console.log(w)
}
const f1=(z)=>{
let s=2;
return v=s+z
}
const f2=()=>{
let q=2;
return v+q
}
two(f1,f2,3)