I usually set object properties like so,
// Boolean
this.listening = config.listening || true;
But config.listening
is either true or false, and in this case this.listening
will always be true because if config.listening
is false it will equal true.
Is there a better way to set these boolean properties without having to do an if statement?
Is there a if isset function in javascript to check it exists rather than what it equals to?