Skip to content

Commit bd1c1e5

Browse files
committed
update arrow function
1 parent 06b8da1 commit bd1c1e5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Example/Arrow/ArrowFunction.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<script>
8+
//const functionName = (parameters) => {
9+
// function body
10+
//};
11+
12+
// Arrow function
13+
14+
const msg = () => {
15+
console.log("welcome to codeswithpankaj.com")
16+
}
17+
18+
msg();
19+
20+
// Arrow function to calculate the sum of two numbers
21+
const sum = (a, b) => {
22+
console.log(a+b)
23+
};
24+
25+
sum(78,90);
26+
27+
// return
28+
// Arrow function to calculate the sum of two numbers
29+
const mul = (a, b) => {
30+
return a * b;
31+
};
32+
33+
console.log(mul(34,56))
34+
35+
36+
</script>
37+
</head>
38+
<body>
39+
40+
</body>
41+
</html>

0 commit comments

Comments
 (0)