Skip to content

Commit fd75bbe

Browse files
committed
Translate "strange-instanceof" task and solution
1 parent cd20212 commit fd75bbe

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Yeah, looks strange indeed.
1+
بله، واقعا عجیب به نظر می‌رسد.
22

3-
But `instanceof` does not care about the function, but rather about its `prototype`, that it matches against the prototype chain.
3+
اما `instanceof` به تابع اهمیتی نمی‌دهد بلکه `prototype` آن مهم است که در زنجیره پروتوتایپی همتای آن پیدا شود.
44

5-
And here `a.__proto__ == B.prototype`, so `instanceof` returns `true`.
5+
و اینجا `a.__proto__ == B.prototype` برقرار است پس `instanceof` مقدار `true` برمی‌گرداند.
66

7-
So, by the logic of `instanceof`, the `prototype` actually defines the type, not the constructor function.
7+
پس بنابر منطق `instanceof`، ویژگی `prototype` در واقع نوع را تعریف می‌کند نه تابع تابع سازنده را.

1-js/09-classes/06-instanceof/1-strange-instanceof/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# Strange instanceof
5+
# یک instanceof عجیب
66

7-
In the code below, why does `instanceof` return `true`? We can easily see that `a` is not created by `B()`.
7+
در ک پایین، چرا `instanceof` مقدار `true` را برمی‌گرداند؟ ما می‌توانیم به راحتی ببینیم که `a` توسط `B()` ساخته نشده است.
88

99
```js run
1010
function A() {}

0 commit comments

Comments
 (0)