I usually set the properties of an object so that
// Boolean this.listening = config.listening || true;
But config.listening is either true or false, in which case this.listening will always be true, because if config.listening false, it will be true.
Is there a better way to set these boolean properties without having to execute an if statement?
Is there an ifset function in javascript to test it, and not that it is equal?
source share