Random Tid Bits
Heres some programming tid bits that really didn’t deserve their own post, so I grouped them all together into one post! 😛 else-switch We all know about the common else-if language construct that is available in almost all programming languages, but here one you might of not been aware of: the else-switch statement. [code lang=”javascript”] if(false) { } else switch(number) { case 0: //do something break; case 1: //do something else break; default: //do default action } [/code] Actually, you can follow if with any control statement. For instance, you can have an else-return or an else-break statement. This might be old news to some programmers, but I never knew you could do that!..
Continue Reading