Skip to content

Commit

Permalink
question 3
Browse files Browse the repository at this point in the history
  • Loading branch information
reza-nouri committed Sep 16, 2023
1 parent 0f66545 commit c978987
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fa-IR/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ console.log(shape.perimeter());

#### پاسخ: B

Note that the value of `diameter` is a regular function, whereas the value of `perimeter` is an arrow function.
توجه داشته باشید که تابع `diameter` یک regular function میباشد, در حالی که تابع `perimeter` یک تابع arrow function میباشد.

With arrow functions, the `this` keyword refers to its current surrounding scope, unlike regular functions! This means that when we call `perimeter`, it doesn't refer to the shape object, but to its surrounding scope (window for example).
در توابع از نوع arrow function, کلمه کلیدی `this` به محدوده خودش اشاره دارد, بر خلاف توابع از نوع regular function! این به این معنی است که وقتی تابع `perimeter` را فراخوانی میکنیم, به شی shape اشاره نمیکنید, اما به محدوده اطراف خود دسترسی دارد (برای مثال شی window).

There is no value `radius` on that object, which returns `NaN`.
برای متغیر `radius` در شی آن مقداری وجود ندارد, که مقدار `NaN` را بازگشت میدهد.

</p>
</details>
Expand Down

0 comments on commit c978987

Please sign in to comment.