Skip to content

Commit 5ae279a

Browse files
authored
fix conflict --sync
1 parent 16823bb commit 5ae279a

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

  • 1-js/02-first-steps/12-nullish-coalescing-operator

1-js/02-first-steps/12-nullish-coalescing-operator/article.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,11 @@ alert(height || 100); // 100
6363
alert(height ?? 100); // 0
6464
```
6565
66-
<<<<<<< HEAD
6766
هنا `height || 100` تعامل الصفر كـ `null`, `undefined` أو أي قيمة زائفة. اذا الصفر يصبح `100`.
6867
6968
ولكن `height ?? 100` ترجع `100` إذا كان فقط `height` يساوي تمامًا `null` أو `undefined`. اذا الصفر يبقى "كما هو".
7069
7170
يعتمد السلوك الافضل على حالة الاستخدام. تكون `??` الطريقة الافضل عندما يكون صفر height قيمة صالحة.
72-
=======
73-
Here, `height || 100` treats zero height as unset, same as `null`, `undefined` or any other falsy value. So the result is `100`.
74-
75-
The `height ?? 100` returns `100` only if `height` is exactly `null` or `undefined`. So the `alert` shows the height value `0` "as is".
76-
77-
Which behavior is better depends on a particular use case. When zero height is a valid value, then `??` is preferrable.
78-
>>>>>>> b52aa942a8e9b75ba8a65124c22593171e273bb6
7971
8072
## الأولوية
8173

0 commit comments

Comments
 (0)