title: Add new object to existing array of objects jquery/javascript
body: <p>I have an array of objects (containing my stimuli) and a function (see extract below) that collects reaction times and 'pushes' all reaction times to a global variable.</p>
  
  <pre><code>var stim = [  {name:"A", path:".../a.jpg", type: P}, 
                {name:"A", path:".../a.jpg", type: T}, 
                {name:"A", path:".../a.jpg", type: I}
             ];
  
  var reac_arr = [];
  
  $(function(){ ...    var reac_time = t2-t1;
                       react_arr.push(reac_time);
              };
  </code></pre>
  
  <p>Now I want to add the variable with all my reaction times to stim as object "reaction".
  So that in the end I have the reaction time, the type, the path, and the name for all my stimuli, something like this:</p>
  
  <pre><code>var stim = [  {name:"A", path:".../a.jpg", type: P, reaction: 123}, 
                {name:"A", path:".../a.jpg", type: T, reaction: 876},
                {name:"A", path:".../a.jpg", type: I, reaction: 725}
             ];
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>stim.reaction = react_arr;
  </code></pre>
  
  <p>but that's not working.</p>
  
  <p>I need this to analyse how reaction times differ across different types of stimuli. I found answers on this for java but these weren't helping for my problem.</p>