From cea9d8c9c2e7de11c5899c13f70c5117383eb974 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 8 Jun 2020 10:55:41 +0300 Subject: [PATCH] minor fixes --- .../12-nullish-coalescing-operator/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/02-first-steps/12-nullish-coalescing-operator/article.md b/1-js/02-first-steps/12-nullish-coalescing-operator/article.md index 56365f7b..f0f6687a 100644 --- a/1-js/02-first-steps/12-nullish-coalescing-operator/article.md +++ b/1-js/02-first-steps/12-nullish-coalescing-operator/article.md @@ -60,11 +60,11 @@ alert(height || 100); // 100 alert(height ?? 100); // 0 ``` -Here, `height || 100` treats zero height as unset, same as `null`, `undefined` or any other falsy value. So the alert shows `100`. +Here, `height || 100` treats zero height as unset, same as `null`, `undefined` or any other falsy value. So the result is `100`. -The `height ?? 100` returns `100` only if `height` is exactly `null` or `undefined`. So the alert shows the height value `0` "as is". +The `height ?? 100` returns `100` only if `height` is exactly `null` or `undefined`. So the `alert` shows the height value `0` "as is". -Which behavior is better depends on a particular use case. When zero height is a valid value, that we shouldn't touch, then `??` is preferrable. +Which behavior is better depends on a particular use case. When zero height is a valid value, then `??` is preferrable. ## Precedence