Skip to content

Commit 84265f8

Browse files
authored
update arraw function type
1 parent b974aff commit 84265f8

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// basic Arrow funciton
2+
3+
const greet = () => console.log("Good Morning");
4+
5+
greet();
6+
7+
// use arg..
8+
9+
const info = (Name,Age) => {
10+
console.log(`My name is ${Name} and age is ${Age}`);
11+
}
12+
13+
info("Nishant",12);
14+
15+
// return type + arg.
16+
17+
let addNumbers = (a, b) => {
18+
let result = a + b;
19+
return result;
20+
}
21+
let sum = addNumbers(5, 8);
22+
console.log("The sum is " + sum);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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 src="Arrow.js"></script>
8+
</head>
9+
<body>
10+
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)