-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunc.html
More file actions
48 lines (28 loc) · 865 Bytes
/
Copy pathfunc.html
File metadata and controls
48 lines (28 loc) · 865 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript Functions</title>
</head>
<body>
<h1>JavaScript Functions</h1>
<p>A function is a block of code designed to perform a particular task. It is executed when "something" invokes it (calls it).</p>
<h2>Function Declaration</h2>
<pre><code>function myFunction() {
// code to be executed
}</code></pre>
<h2>Function Expression</h2>
<pre><code>const myFunction = function() {
// code to be executed
};</code></pre>
<h2>Arrow Function</h2>
<pre><code>const myFunction = () => {
// code to be executed
};</code></pre>
<h2>Calling a Function</h2>
<pre><code>myFunction();</code></pre>
<script src="calculator.js">
</script>
</body>
</html>