From 79e96d0c7bb8a11d68e1ea130b842a4bcb3c5180 Mon Sep 17 00:00:00 2001 From: factotumMeister <43189813+factotumMeister@users.noreply.github.com> Date: Sat, 10 Nov 2018 13:57:52 -0800 Subject: [PATCH] fixed examples (#21527) made changes to examples to be more javascript standard --- .../javascript/if-else-statement/index.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/guide/english/javascript/if-else-statement/index.md b/guide/english/javascript/if-else-statement/index.md index cb9fdd6c29..82b8928a4a 100644 --- a/guide/english/javascript/if-else-statement/index.md +++ b/guide/english/javascript/if-else-statement/index.md @@ -47,24 +47,25 @@ if (condition) { **Using** `if...else`: ```javascript - // If x=5 z=7 and q=42. If x is not 5 then z=19. - if (x == 5) { + // If x=5 then z=7 and q=42 else z=19. + if (x === 5) { z = 7; - q = 42 - else + q = 42; + }else{ z = 19; + } ``` **Using** `else if`: ```javascript -if (x < 10) +if (x < 10){ return "Small number"; -else if (x < 50) +}else if (x < 50){ return "Medium number"; -else if (x < 100) +}else if (x < 100){ return "Large number"; -else { +}else { flag = 1; return "Invalid number"; }