There's no optimisation improvement (EDIT: possibly a hasty statement, DCoder's comment for e.g. is valid), but you could make the argument that it's just prudent practice.
For example, a programmer might accidentally use a single =
instead of ==
- resulting in assignment instead of an equality check.
The following code would silently evaluate with no error:
var a = null;
function b(a){a=null&&console.log("ohai")} // notice the single =
b(a); // nothing
However, the way google does it, it produces an error in the console (tested in Chrome):
var a = null;
function b(a){null=a&&console.log("ohai")} // notice the single =
b(a); // produces error Uncaught ReferenceError: Invalid left-hand side in assignment
Hence, using null
as the left-hand side makes these kind of user errors easier to spot.