-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions 1.html
More file actions
55 lines (46 loc) · 1.07 KB
/
functions 1.html
File metadata and controls
55 lines (46 loc) · 1.07 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
<!-- adding 2 parameters using a function -->
<script>
function addingNumbers(a,b){
return a+b;
}
document.write(addingNumbers(20,30));
</script>
<!-- 1.Arrow Function -->
<script>
//In arrow functions we use const for declaring functions
const hello =()=>{
document.write("How are you ?");
document.write("<br>");
return "I'm Good";
}
let x=hello();
document.write(x);
</script>
<!-- 2.Arrow Function -->
<script>
const multiplyNumbers=(a,b)=>{
let c=a*b;
return c;
}
let x=multiplyNumbers(543,20);
document.write(x);
</script>
<!-- 3.Arrow function -->
<script>
const loop=()=>{
const powers={
"ROLEX" : 100,
"DILLI" : 90,
"VIKRAM" : 80,
"AMAR" : 70,
"SANDHANAM" : 60,
"ANBU" : 50,
"ADAIKALAM" : 40,
}
for(let i in powers){
document.write("The Power Of ~"+i+" is "+powers[i]);
document.write("<br/>");
}
}
loop();
</script>