title: ReactJS : Immutable.js : merge two Json objects
body: <p>I'm using React, Redux &amp; immutable. I tried to merge two Json objects, data and expected result is given below,</p>
  
  <pre><code>obj1 = 
  {id: 1, first_name: "abc", surname: "def", children: ["kid1", "kid2"]}
  
  obj2 = 
  {first_name: "abc", surname: "def", email: "abc.def@gmail.com", mobile: ""}
  
  mergedObj = {id: 1, first_name: "abc", surname: "def", email: "abc.def@gmail.com", Mobile: "",  children: ["kid1", "kid2"]}
  </code></pre>
  
  <p>If data is not available on obj1, it should be taken it from obj2. </p>
  
  <p>I tried using immutable merge as outlined below,</p>
  
  <pre><code>import Immutable, {merge} from "immutable";
  const mergedObj = merge(Immutable.fromJS(obj2), Immutable.fromJS(obj1));
  console.log(mergedObj)
  </code></pre>
  
  <p>Result is same as obj2, essentially, merge is not happening,</p>
  
  <pre><code>{first_name: "abc", surname: "def", email: "abc.def@gmail.com", mobile: ""}
  </code></pre>