Skip to content

Commit 1c1f575

Browse files
committed
Arrow Function
1 parent 740f182 commit 1c1f575

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

arrow-function.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// আগে যেভাবে ফাংশন কল করা হত-
2+
3+
function hello() {
4+
return "Hello World!";
5+
}
6+
7+
console.log(hello());
8+
9+
// চাইলে এভাবেও কল করা যায়।
10+
11+
another = function() {
12+
return "Hello World!";
13+
}
14+
15+
16+
// Arrow Function যদি প্যারামিটার লাগে তাহলে এভাবে কল করতে হবে।
17+
18+
arrowFunction = () => {
19+
return "Arrow Function with !";
20+
}
21+
22+
console.log(arrowFunction());
23+
24+
25+
// প্যারামিটার ছাড়া, একলাইনের এরো ফাংশন কল করার নিয়ম
26+
arrowFunctionSingleLine = () => 'Single Line Arrow Function';
27+
28+
console.log(arrowFunctionSingleLine());
29+
30+
// প্যারামিটার সহ এরো ফাংশন কল করার নিয়ম।
31+
test = (num1, num2) => {
32+
return num1 + num2;
33+
}
34+
35+
console.log(test(5, 5));

0 commit comments

Comments
 (0)