title: Create array and push into it in one line
body: <p>The following is just a theoretical JavaScript question. I am curious if the following can be converting into a single statement:</p>
  
  <pre><code>if(!window.foo){
    window.foo = [];
  }
  window.foo.push('bar');
  </code></pre>
  
  <p>everyone has probably written this code before, but can it be done in one line?<br>
  At first I thought something like this would work:</p>
  
  <pre><code>(window.foo || window.foo = []).push('bar');
  </code></pre>
  
  <p>but that doesn't work because of an invalid assignment. Next I tried chaining something on the push, but that doesn't work because push does not return the array. </p>
  
  <p>Any thoughts on if this can be done in plain JavaScript?<br>
  (the result by the way should be that <code>window.foo = ['bar']</code>)</p>