what's the difference/purpose of using a tree of else if(s) against a series of if(s)? :confused:
Printable View
what's the difference/purpose of using a tree of else if(s) against a series of if(s)? :confused:
Speed. A series of ifs will all be checked, but if, for example the first if condition is met, the rest in the if-else block will not be tested. This only works if the conditions are mutually exclusive, but if several can be met at once, you'd need to use a series of ifs, or a series of ef-else blocks.