You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
আরেকটা উদাহরণ দেখা যাকঃ ভ্যারিয়েবল `from` ফাংশনে ডিক্লিয়ার করলাম। নোটঃ ফাংশন `from` কে পরিবর্তন করে, কিন্তু এই পরিবর্তন বাইরে কোথাও দেখা যাবে না। কারণ, ফাংশন সবসময় ভ্যাল্যুর একটা কপি নিজের কাছে রেখে দিবে।
157
158
159
+
158
160
```jsrun
159
161
functionshowMessage(from, text) {
160
162
@@ -180,7 +182,7 @@ alert( from ); // Ann
180
182
তাই একাধিক প্যারামিটারের ক্ষেত্রে `showMessage(from, text)` একটা আর্গুমেন্ট দিলেও প্রোগ্রাম চলবে। যেমনঃ
181
183
182
184
```js
183
-
showMessage('Ann');
185
+
showMessage("Ann");
184
186
```
185
187
186
188
এইখানে কোনো ভুল নেই। এমন ফাংশন কল `"Ann: undefined"` রিটার্ন করবে। এখানে `text` প্যারামিটারের মান বলে দেওয়া হয় নাই। তাই `text===undefined` ধরে নিবে প্রোগ্রাম।
@@ -242,6 +244,7 @@ function showMessage(from, text) {
242
244
243
245
````
244
246
247
+
245
248
## ভ্যালু রিটার্ন করা
246
249
247
250
ফাংশন যে কোনো ভ্যালু রিটার্ন করতে পারে।
@@ -306,9 +309,7 @@ function showMovie(age) {
306
309
যদি কোনো ফাংশন কোনো ভ্যালু রিটার্ন না করে, তাহলে `undefined` রিটার্ন করবে।
307
310
308
311
```jsrun
309
-
functiondoNothing() {
310
-
/* empty */
311
-
}
312
+
functiondoNothing() { /* empty */ }
312
313
313
314
alert(doNothing() ===undefined); // true
314
315
```
@@ -322,7 +323,6 @@ function doNothing() {
322
323
323
324
alert(doNothing() ===undefined); // true
324
325
```
325
-
326
326
`````
327
327
328
328
````warnheader="Never add a newline between `return` and the value"
0 commit comments