Skip to content

Commit 93e5fc8

Browse files
authored
Translate a part of article
Line 126 needs more attention
1 parent fb25f85 commit 93e5fc8

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • 1-js/07-object-properties/01-property-descriptors

1-js/07-object-properties/01-property-descriptors/article.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ alert( JSON.stringify(descriptor, null, 2 ) );
100100

101101
حالا بیایید با استفاده از مثال تاثیر پرچم‌ها را ببینیم.
102102

103-
## Non-writable
103+
## غیر قابل نوشتن
104104

105-
Let's make `user.name` non-writable (can't be reassigned) by changing `writable` flag:
105+
بیایید با تغییر دادن پرچم `writable` کاری کنیم که `user.name` غیر قابل نوشتن شود:
106106

107107
```js run
108108
let user = {
@@ -116,25 +116,25 @@ Object.defineProperty(user, "name", {
116116
});
117117

118118
*!*
119-
user.name = "Pete"; // Error: Cannot assign to read only property 'name'
119+
user.name = "Pete"; // مقدار داد 'name' ارور: نمی‌توان به ویژگی فقط‌خواندنی
120120
*/!*
121121
```
122122

123-
Now no one can change the name of our user, unless they apply their own `defineProperty` to override ours.
123+
حالا هیچ‌کس نمی‌تواند اسم کاربر ما را تغییر دهد، مگر اینکه `defineProperty` خودش را برای باطل کردن توصیف‌کننده‌ی ما اعمال کند.
124124

125-
```smart header="Errors appear only in strict mode"
126-
In the non-strict mode, no errors occur when writing to non-writable properties and such. But the operation still won't succeed. Flag-violating actions are just silently ignored in non-strict.
125+
```smart header="ارورها فقط در حالت سخت‌گیرانه ایجاد می‌شوند"
126+
در حالت غیر سخت‌گیرانه، زمانی که ویژگی‌های غیر قابل نوشتن را تغییر و یا کاری مشابه انجام می‌دهیم اروری ایجاد نمی‌شود. اما همچنان این کار انجام نمی‌شود. در حالت غیر سخت‌گیرانه، کارهای نقص‌کننده‌ی پرچم بی سر و صدا نادیده گرفته می‌شوند.
127127
```
128128

129-
Here's the same example, but the property is created from scratch:
129+
اینجا مثالی مشابه داریم اما ویژگی از اول ایجاد شده است:
130130

131131
```js run
132132
let user = { };
133133

134134
Object.defineProperty(user, "name", {
135135
*!*
136136
value: "John",
137-
// for new properties we need to explicitly list what's true
137+
// است true برای ویژگی‌های جدید ما باید به طور واضح لیست کنیم که چه چیزی
138138
enumerable: true,
139139
configurable: true
140140
*/!*

0 commit comments

Comments
 (0)