My question on conditional statements has been answered for java here: Is if(x) same as if(x==true)?
But I don't know java, and I do know some javascript but do not want to make assumption... so... can someone confirm that the following two conditional tests are executed the same (except one has fewer keystrokes)
function myFunction()
{
return true;
}
if( myFunction()===true )
{
/* do something when true */
}
if( myFunction() )
{
/* do something when true */
}
I believe both if statements are executed the same... but would appreciate confirmation...
thanks
Aucun commentaire:
Enregistrer un commentaire