simplify if .. else in javascript
<p>my mind is blank and I can't think of the solution...</p>

<p>I have the following code:</p>

<pre><code>if (onlySelected === true) {
    if (r.selected == true) {
        result.push(pushValue);
    }
}
else {
    result.push(pushValue);
}
</code></pre>

<p>how can I simplify this code into this:</p>

<pre><code>if (condition) { result.push(pushValue) } 
</code></pre>
