From f9ad7195e0166104476f8eebc10fd62f9486f089 Mon Sep 17 00:00:00 2001 From: Moudi Kawi <59413818+mKawi@users.noreply.github.com> Date: Fri, 8 May 2020 16:56:08 +0100 Subject: [PATCH] Fix Typo in logical operators true || alert("printed") false || alert("not printed") This is confusing to a student as the first won't be printed, but the second will print "not printed". I've reversed it to this so it makes much more sense to a learner: true || alert("not printed") false || alert("printed") --- 1-js/02-first-steps/11-logical-operators/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/11-logical-operators/article.md b/1-js/02-first-steps/11-logical-operators/article.md index 79cfbacd..03c30c91 100644 --- a/1-js/02-first-steps/11-logical-operators/article.md +++ b/1-js/02-first-steps/11-logical-operators/article.md @@ -128,8 +128,8 @@ This leads to some interesting usage compared to a "pure, classical, boolean-onl In the example below, the first message is printed, while the second is not: ```js run no-beautify - *!*true*/!* || alert("printed"); - *!*false*/!* || alert("not printed"); + *!*true*/!* || alert("not printed"); + *!*false*/!* || alert("printed"); ``` In the first line, the OR `||` operator stops the evaluation immediately upon seeing `true`, so the `alert` isn't run.