-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodewarsChallenge55.html
More file actions
31 lines (28 loc) · 1003 Bytes
/
codewarsChallenge55.html
File metadata and controls
31 lines (28 loc) · 1003 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Function Senquence 2</title>
</head>
<body>
<h1>JavaScript Functions</h1>
<h2>Function Sequence</h2>
<p>JavaScript functions are executed in the sequence they are called.</p>
<p>The result of the calculation is:</p>
<p id="demo"></p>
<script>
function myDisplayer(some){
document.getElementById("demo").innerHTML = some;
}
function myCalculator(num1, num2){
let sum = num1 + num2;
return sum;
}
let result = myCalculator(10, 5);// Here the logic is that the result is the sum of the two numbers 10 and 5 as is has been defined in the function myCalculator
/*<!-- This line calls the function 'myDisplayer' and passes 'result' as an argument.
Ensure that 'result' is defined and holds the expected value before this call. -->*/
myDisplayer(result);
</script>
</body>
</html>