title: How to merge two objects, overriding null values?
body: <p>I'd like to merge two similar but not identical objects and override null values in one of them, if such exist. For example I'd have these two objects:</p>
  
  <pre><code>const obj1 = {
      a: 1,
      b: '',
      c: [],
      d: null
  }
  
  const obj2 = {
      a: 2,
      b: null,
      d: 1
  }
  </code></pre>
  
  <p>And the effect of merge should be:</p>
  
  <pre><code>const objMerged = {
      a: 2,
      b: '',
      c: [],
      d: 1
  }
  </code></pre>
  
  <p>In other words, the most important source of data in the merged object is <code>obj2</code> but it lacks some properties from <code>obj1</code>, so they need to be copied and also some of the <code>obj2</code> values are <code>null</code> so they should be taken from <code>obj1</code> as well.</p>
  
  <p>EDIT
  I tried:</p>
  
  <pre><code>_.extend({}, obj1, obj2) 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Object.assign({}, obj1, obj2)
  </code></pre>