title: How to deeply merge two object values by keys
body: <p>Trying to see if there is any javascript library functionality that can merge the values for a specific key of two json objects</p>
  
  <pre><code>var x ={ "student-marks":{'math':1,'physics':5} };
  var y ={ "student-marks":{'chemistry':3,'history':2} };
  </code></pre>
  
  <p>using $.extend and $.merge giving below results</p>
  
  <pre><code>$.extend({},x,y)  leads to  { "student-marks":{'chemistry':3,'history':2} }
  
  $.merge(x,y) leads to { "student-marks":{'math':1,'physics':2} }
  </code></pre>
  
  <p>what I am looking for is ‍<code>{ "student-marks":{'math':1,'physics':5, 'chemistry':3,'history':2} }‍</code></p>