In javascript, if we have some code such as
var a = \"one\";
var b = q || a;
alert (b);
The logical OR operator will assign a\'s value to b
The way || works in Javascript is:
true, return the left operand&& works similarly.
You can make use of this for in-line existence checks, for example:
var foo = (obj && obj.property)
will set foo to obj.property if obj is defined and "truthy".