Possible Duplicate:
What does “options = options || {}” mean in Javascript?
Looking at the YouTube source…
var yt = yt || {};
Does that mean.. set yt to yt if yt exists, else create a new object?
If that’s the case, I didn’t think you can put a condition when declaring a variable.
Assign the value of
ytback toytunless it is any of0,NaN,false,null,"", orundefined(i.e. it’s falsy), in which case assign{}toyt.This works because each of the values in the list above evaluate to
falsein a boolean expression.