-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01-ArithmeticOperations.html
59 lines (45 loc) · 1.28 KB
/
01-ArithmeticOperations.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
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Arithmetic Operations</title>
<script type="text/javascript">
//****** Arithmetic Operations by Simple Functions
var mulitply = function (x, y) {
return x * y;
};
console.log(mulitply(5,6));
//output 30
var Sum = function (x, y) {
return x + y;
};
console.log(Sum(4,4));
//output 8
var subtract = function (x, y) {
return x - y;
}
console.log(subtract(5,3));
//output 2
var Divide = function (x, y) {
return x / y;
}
console.log(Divide(10,2));
//output 5
//******* ****** Arithmetic Operations by FatArrow Functions ******* ******
var mul=(a,b)=>{return a * b};
console.log(mul(4,5));
//output 20
var add=(x,y)=>{return x+y};
console.log(add(5,6));
//output 11
var sub=(x,y)=>{return x-y};
console.log(sub(10,2));
//output 8
var dividedValue=(x,y)=>{return x/y;}
console.log(dividedValue(12,3));
//output 4
</script>
</head>
<body>
<div id="div1"></div>
</body>
</html>