-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask3.js
More file actions
55 lines (44 loc) · 1.09 KB
/
Task3.js
File metadata and controls
55 lines (44 loc) · 1.09 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
// Func declaration finding area
function area(length,width)
{
console.log("Area:",(length*width));
}
area(10,10)
// func expression finding area
let Area2=function(length2,width2)
{
console.log("Area2:",(length2*width2));
}
Area2(10,10)
// arrow func finding area
let area3=(length3,width3)=>
{
console.log("Area3:",(length3*width3));
}
area3(10,10)
// func declarationFinding percent of subjects
function percentage(tamil,english,science,chemistry,maths)
{
console.log("percentage is ",(tamil+english+science+chemistry+maths)/500*100);
}
percentage(90,90,90,90,90)
// func expression
let percentage1=function(tamil1,english1,science1,chemistry1,maths1)
{
console.log("percentage1 is",(tamil1+english1+science1+chemistry1+maths1)/500*100);
}
percentage1(90,90,90,90,90)
// arrow function
let percentage2=(tamil2,english2,science2,chemistry2,maths2)=>
{
console.log("percentage2 is",(tamil2+english2+science2+chemistry2+maths2)/500*100);
}
percentage2(90,90,90,90,90)
// IIFE
(
function(len,wid)
{
console.log("areaiif is",(len*wid));
}
)
(10,10)