Update The-Basics.md

if/else statements can't be used inside class definition, just inside class methods. This may confuse beginners.
This commit is contained in:
Valerij Ivashchenko
2016-07-16 12:38:35 +03:00
committed by GitHub
parent 2080260c85
commit ed0063cafd

View File

@@ -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.