-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (39 loc) · 1.59 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
// Create a simple function with name firstFunction().
// and stored the value in console ('This is my first function')
// and call the function firstFunction().
function firstFunction() {
console.log("This is my first function");
}
firstFunction();
// Create a function with name square().
// The function square() takes one parameter and parameter name is num.
// Return the parameter (num) multiplied by itself. Example like (num * num)
// and call the function square() and store the result in console.
function square(num) {
return num * num;
}
console.log(square(8));
// Create a one function with name is Addition()
// The function Addition() takes Four parameter like num1,num2,num3,num4.
// take a one variable in function that is result and stored the addition of this four paramater in the result
// Resturn the result variable under the function
// and now call the Addition() function
function Addition(num1, num2, num3, num4) {
result = num1 + num2 + num3 + num4;
return result;
}
Addition(10, 20, 30, 90);
// alert(Addition(10, 20, 30, 90));
// console.log(Addition(10, 20, 30, 90));
</script>
</body>
</html>