title: Add object to the beginning of array using spread operator
body: <p>I have an array like this:</p>
  
  <pre><code>var oldArray = [{'value': '1', 'label': 'a'}, {'value': '2', 'label': 'b'}]
  </code></pre>
  
  <p>what I want is using spread operator add a new object at the beginning of that array:</p>
  
  <p>BTW this works:</p>
  
  <pre><code>var oldArray = [{'value': '1', 'label': 'a'}, {'value': '2', 'label': 'b'}]
  var newObj = {'value': 'all', 'label': 'all'}
  var result = [newObj, ...oldArray]
  </code></pre>
  
  <p>But generates a key "newObj" like this:</p>
  
  <pre><code>var oldArray = [newObj : {'value': 'all', 'label': 'all'}, 0: {'value': '1', 'label': 'a'}, 1:{'value': '2', 'label': 'b'}]
  </code></pre>
  
  <p>And I want the key to be auto generated like if I do this:</p>
  
  <pre><code>var result = [{'value': 'all', 'label': 'all'}, ...oldArray]
  </code></pre>
  
  <p>And imagine the result is this:</p>
  
  <pre><code>var oldArray = [newObj : {0: 'all', 'label': 'all'}, 1: {'value': '1', 'label': 'a'}, 2:{'value': '2', 'label': 'b'}]
  </code></pre>
  
  <p>but that gives me an error.</p>
  
  <p>Right now I'm using unshift and it works, I wonder if there's a way to do the same with spread operator.</p>