As in here for example:
var h , aa = aa || {} , m = this ,
What's the meaning of "|| {}" ?
As in here for example:
var h , aa = aa || {} , m = this ,
What's the meaning of "|| {}" ?
It prevents you object from being undefined. E.g. if you write:
a = B || {};
and B will be undefined --> you will assign empty object instead of FALSY value (undefined).
Sum up: if value is "falsy value" assign empty object.
Here you have all falsy values:
aa = aa || {}
This is setting a default value for the variable aa
. If aa
isn't "truthy" at the time this line executes, it will set it to {}
.
It's a default initialization in case aa
is falsy. If aa
is falsy (undefined, 0, empty string,...), aa
is initialized to an empty object.