Possible Duplicate:
What does “options = options || {}” mean in Javascript?
What does the following line of Javascript code do?
var somevar = window.somevar || {};
It sets somevar to window.somevar if window.somevar exists and is not boolean false, otherwise it sets it to an empty object {}
It's a common idiom for handling variables which may not have been set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With