Skip to content

Commit aeb61df

Browse files
authored
fix logical op conflicts
1 parent bb742f1 commit aeb61df

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

  • 1-js/02-first-steps/11-logical-operators

1-js/02-first-steps/11-logical-operators/article.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,28 +126,16 @@ alert(undefined || null || 0); // 0 (الكل falsy, ترجع آخر قيمة)
126126

127127
أهمية هذه الميزة تصبح ملحوظة إذا كانت القيمة الممررة عبارة عن عملية لها آثار جانبية مثل تخصيص قيمة متغير أو استدعاء دالة
128128

129-
<<<<<<< HEAD
130129
في هذا المثال سيتم طباعة الرسالة الأولى ولن يتم طباعة الثانية:
131130

132-
```js run no-beautify
133-
*!*false*/!* || alert("printed");
134-
*!*true*/!* || alert("not printed");
135-
=======
136-
In the example below, only the second message is printed:
137-
138131
```js run no-beautify
139132
*!*true*/!* || alert("not printed");
140133
*!*false*/!* || alert("printed");
141-
>>>>>>> 69e44506c3e9dac74c282be37b55ba7ff122ae74
142134
```
143135

144136
في السطر الثاني يتوقف العامل OR `||` مباشرة عند الوصول إلى `true` لذلك فإن `alert` لا ينفذ.
145137

146-
<<<<<<< HEAD
147-
أحيانًا يستخدم الناس هذه الخاصية لتنفيذ أوامر فقط إذا كان الجزء الأيسر truthy.
148-
=======
149-
Sometimes, people use this feature to execute commands only if the condition on the left part is falsy.
150-
>>>>>>> 69e44506c3e9dac74c282be37b55ba7ff122ae74
138+
أحيانًا يستخدم الناس هذه الخاصية لتنفيذ أوامر فقط إذا كان الجزء الأيسر زائف.
151139

152140
## && (AND)
153141

0 commit comments

Comments
 (0)