Skip to content

Commit 992b32f

Browse files
authored
Translate the new part
1 parent fc0f0ed commit 992b32f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • 1-js/02-first-steps/16-function-expressions

1-js/02-first-steps/16-function-expressions/article.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ let sayHi = function() {
2222
};
2323
```
2424

25-
Here we can see a variable `sayHi` getting a value, the new function, created as `function() { alert("Hello"); }`.
25+
اینجا می‌توانیم متغیر `sayHi` را ببینیم که مقداری را دریافت می‌کند، تابع جدید، که به صورت `function() { alert("Hello"); }` ساخته شده است.
2626

27-
As the function creation happens in the context of the assignment expression (to the right side of `=`), this is a *Function Expression*.
27+
چون ایجاد تابع با زمینه (context) عبارت مقداردهی (سمت راست `=`) رخ می‌دهد، این یک *Function Expression* است.
2828

29-
Please note, there's no name after the `function` keyword. Omitting a name is allowed for Function Expressions.
29+
لطفا در نظر داشته باشید، هیچ اسمی بعد از کلمه کلیدی `function` وجود ندارد. حذف کردن اسم برای Function Expressionها مجاز است.
3030

31-
Here we immediately assign it to the variable, so the meaning of these code samples is the same: "create a function and put it into the variable `sayHi`".
31+
اینجا ما بلافاصله آن را به متغیر اختصاص می‌دهیم پس معنی این قطعه‌های کد یکسان است: «تابعی بساز و آن را درون متغیر `sayHi` قرار بده».
3232

33-
In more advanced situations, that we'll come across later, a function may be created and immediately called or scheduled for a later execution, not stored anywhere, thus remaining anonymous.
33+
در موقعیت‌های پیشرفته‌تر، که بعدا به آن‌ها می‌رسیم، یک تابع ممکن است ایجاد و بلافاصله فراخوانی شود یا برای اینکه بعدا اجرا شود برنامه‌ریزی صورت گیرد و جایی ذخیره نشود، از این رو ناشناس بماند.
3434

35-
## Function is a value
35+
## تابع یک مقدار است
3636

37-
Let's reiterate: no matter how the function is created, a function is a value. Both examples above store a function is `sayHi` variable.
37+
بیایید تکرار کنیم: مهم نیست که تابع چگونه ساخته شده است، یک تابع همیشه یک مقدار است. هر دو مثال بالا تابعی را درون متغیر `sayHi` ذخیره می‌کنند.
3838

3939
ما حتی می‌توانیم آن مقدار را با استفاده از `alert` چاپ کنیم:
4040

0 commit comments

Comments
 (0)