-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.html
More file actions
53 lines (41 loc) · 1.23 KB
/
Copy pathfunction.html
File metadata and controls
53 lines (41 loc) · 1.23 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript</title>
</head>
<body>
<script>
//Argument and Return
function areaOfCircle(radius) {
const area = 3.14 * radius * radius;
return area;
}
const area1 = areaOfCircle(5);
console.log(`Area of circle : ${area1} sq.m`);
//Argument but no return
function areaOfSquare(side) {
const area = side * side;
console.log(`Area of Square : ${area} sq.m`);
}
areaOfSquare(10);
//No Argument but return
const length = 4;
const breadth = 2;
function areaOfRectangle() {
const area = length * breadth;
return area;
}
const area2 = areaOfRectangle();
console.log(`Area of Rectangle : ${area2} sq.m`);
//No Argument no return
const radius = 8;
function circumferenceOfCircle() {
const circumference = 2 * 3.14 * radius;
console.log(`Circumference of circle : ${circumference} m`);
}
circumferenceOfCircle();
</script>
</body>
</html>