title: Merge two JavaScript objects
body: <p>I've got a big JavaScript object literal I am reusing with very few modifications each time. It would be good to make a variable containing most of the object, then reference that each time I need it.</p>
  
  <p>But how can I do that? I tried to do this, but it didn't work:</p>
  
  <pre><code>var settings = {
   legend: {
    enabled:false
   },
   yAxis: {
    title: {
     text: 'Impact'
    }
   },
   tooltip: {
    formatter: function() {
     return 'Impact: '+ this.y +' points'
    }
   },
   credits: {
    enabled: false
   },
   exporting: {
    enabled: false
   }
  };
  
  jQuery(document).ready(function() {   
   new Highcharts.Chart({
    chart: {
     renderTo: 'chart',
     defaultSeriesType: 'column',
     width: 450
    },         
    title: {
     text: 'Comparison of Impact for Male age 23'
    },
    xAxis: {
     categories: [
      'Good brain', 
      'Good humor', 
      'Good will'
     ],
    },
    series: [{
     data: [5,2,8]
    }],
    settings // &lt;-- HERE
   });
  }); 
  </code></pre>