Looking at an online source code I came across this at the top of several source files.
var FOO = FOO || {}; FOO.Bar = …;
But I have no ide
The || operator takes two values:
||
a || b
If a is truthy, it will return a. Otherwise, it will return b.
a
b
The falsy values are null, undefined, 0, "", NaN and false. The truthy values are everything else.
null
undefined
0
""
NaN
false
So if a has not been set (is it undefined) it will return b.