Perhaps someone with advanced knowledge of JavaScript can resolve this question.
In many programming languages "else if()" is an integral part of the language. I have not been able to locate it anywhere in the official JavaScript Reference Manual or Guide. Although it often works I suspect that it is not reliable.
The first version is desirable. The second version is what will always work according to the manual.
Can someone please shed some light on this issue? Thanks.
In many programming languages "else if()" is an integral part of the language. I have not been able to locate it anywhere in the official JavaScript Reference Manual or Guide. Although it often works I suspect that it is not reliable.
The first version is desirable. The second version is what will always work according to the manual.
PHP Code:
if(...)
{....}
else if(...)
{...}
vs
if(..)
{...}
else
{
if(...)
{...}
}
Comment