I wanna know what means the following line in javascript:
$variable1 && $variable2
The line is exactly like a said, without nothing more.
I wanna know what means the following line in javascript:
$variable1 && $variable2
The line is exactly like a said, without nothing more.
$variable1
and $variable2
are 2 bool values (rightly pointed in comments not always) and its checking if they both are true.
They can also be a jQuery selector's length .. For example:
var $variable1 = someselector.length;
if($variable1)
{
//Some code
}
in the above statement length is an int.. but used to check if the selector exists or not.