title: How do I combine object of arrays with the same index?
body: <p>I have this object of arrays:</p>
  
  <pre><code>var a = {1: "one", 2: "two", 3: "three"};
  </code></pre>
  
  <p>And this one</p>
  
  <pre><code>var b = {1: "ONE", 2: "TWO", 4: "four"};
  </code></pre>
  
  <p>And I need to combine the two so the output is like so:</p>
  
  <pre><code>var c = {1: "oneONE", 2: "twoTWO", 3:"three", 4: "four"};
  </code></pre>
  
  <p>I'm having lots of trouble to get this to work. Please help!</p>
  
  <p>edit:
  Ok, so my simplification of my quesiton didn't make much sense..</p>
  
  <p>I am using Firebase to store data.</p>
  
  <pre><code>   var dates = [];
     var ids = [];
     snapshot.forEach(function(childSnapshot) { //makes raw data array
     var date = childSnapshot.val().date;
     var id = childSnapshot.val().task_id;
  
     dates.push(date);
     ids.push(id);          
     });
  
     function cal_list(names, values) { // makes the array read
           var result = [];
           for (var i = 0; i &lt; names.length; i++){
            if(result[names[i]] === undefined) {
                result[names[i]] = values[i];
            }
            else {
                // How do I add the values[i] to the existing date index?
                // if i used result[names[i]] = values[i] -- it only holds a single date. I need a way to add the value to an existing date.
  
  
            }
  
              };
  
    var calendar_list = cal_list(dates, ids);
    populateCal(calendar_list); //Successfully populates cal, but i'm missing tasks.
    console.log(result);
  </code></pre>
  
  <p>The console is showing:
  <code>{12-04-2013: "&lt;a href="/task/-J9oFhGluCZsLBXFof8c"&gt;Test&lt;/a&gt;", 
   12-05-2013: "&lt;a href="/task/-J9PUCxYe2C5gJg7t7gX"&gt;Write a blog post&lt;/a&gt;", 
   12-06-2013: "&lt;a href="/task/-J9PUCxYe2C5gJg7t7gX"&gt;Write a blog post&lt;/a&gt;"}</code></p>
  
  <p>It is overwriting the indexes, and only storing the last ran value. I need a way to combine the values for like dates, so the end result looks like this:</p>
  
  <p><code>{12-04-2013: "&lt;a href="/task/-J9oFhGluCZsLBXFof8c"&gt;Test&lt;/a&gt;&lt;a href="#"&gt;SECOND TASK&lt;/a&gt;&lt;a href="#"&gt;THIRD TASK&lt;/a&gt;",
   12-05-2013: "&lt;a href="/task/-J9PUCxYe2C5gJg7t7gX"&gt;Write a blog post&lt;/a&gt;",
   12-06-2013: "&lt;a href="/task/-J9PUCxYe2C5gJg7t7gX"&gt;Write a blog post&lt;/a&gt;"}</code></p>
  
  <p>edit2: The reason I need it to be in this format is because I am using the Calendario JQuery plugin. The data needs to be in a specific format.</p>
  
  <p>edit3: fixed original code.. i think?</p>