Skip to content

Commit e6f69af

Browse files
committed
javascript function calling and returns the result
1 parent a397ec8 commit e6f69af

File tree

3 files changed

+61
-9
lines changed

3 files changed

+61
-9
lines changed

.gitignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ JavaScript Closures.html
6666
javascript Comparing For and While.html
6767
JavaScript constructor Property.html
6868
javascript Converting Numbers to Strings.html
69-
# JavaScript Date Output.html
70-
# JavaScript Declarations are Hoisted.html
71-
# JavaScript DoWhile Loop.html
72-
# JavaScript Error Handling.html
73-
# JavaScript ForIn Loop.html
74-
JavaScript ForOf Loop.html
75-
JavaScript Function or Getter.html
76-
javascript Function Sequence.html
77-
JavaScript Functions.html
69+
JavaScript Date Output.html
70+
JavaScript Declarations are Hoisted.html
71+
JavaScript DoWhile Loop.html
72+
JavaScript Error Handling.html
73+
JavaScript ForIn Loop.html
74+
# JavaScript ForOf Loop.html
75+
# JavaScript Function or Getter.html
76+
# javascript Function Sequence.html
77+
# JavaScript Functions.html
7878
JavaScript Getter (The get Keyword).html
7979
JavaScript in Head.html
8080
JavaScript Initializations are Not Hoisted.html

JavaScript Functions.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<body>
5+
6+
<h2>JavaScript Functions</h2>
7+
8+
<p>This example calls a function which performs a calculation, and returns the result:</p>
9+
10+
<p id="demo"></p>
11+
12+
<script>
13+
function myFunction(p1, p2) {
14+
return p1 * p2;
15+
}
16+
document.getElementById("demo").innerHTML = myFunction(4, 3);
17+
</script>
18+
19+
</body>
20+
21+
</html>

javascript Function Sequence.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<body>
5+
6+
<h2>JavaScript Function Sequence</h2>
7+
8+
<p>JavaScript functions are executed in the sequence they are called.</p>
9+
10+
<p id="demo"></p>
11+
12+
<script>
13+
function myDisplayer(some) {
14+
document.getElementById("demo").innerHTML = some;
15+
}
16+
17+
function myFirst() {
18+
myDisplayer("Hello");
19+
}
20+
21+
function mySecond() {
22+
myDisplayer("Goodbye");
23+
}
24+
25+
myFirst();
26+
mySecond();
27+
</script>
28+
29+
</body>
30+
31+
</html>

0 commit comments

Comments
 (0)