From ed0063cafdc905033f17c049f3cf02fb607c9657 Mon Sep 17 00:00:00 2001 From: Valerij Ivashchenko Date: Sat, 16 Jul 2016 12:38:35 +0300 Subject: [PATCH] Update The-Basics.md if/else statements can't be used inside class definition, just inside class methods. This may confuse beginners. --- pages/The-Basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/The-Basics.md b/pages/The-Basics.md index 97359d4..5e0bab9 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -42,7 +42,7 @@ if (strpos('testing', 'test') !== false) { // true, as strict comparison was ### If statements -While using 'if/else' statements within a function or class, there is a common misconception that 'else' must be used +While using 'if/else' statements within a function or class method, there is a common misconception that 'else' must be used in conjunction to declare potential outcomes. However if the outcome is to define the return value, 'else' is not necessary as 'return' will end the function, causing 'else' to become moot.