title: Adding single element to an immutable list
body: <p>i want to just add an element to a list somewhere in my immutable object tree.</p>
  
  <p>This question appears to have been answered here :</p>
  
  <p><a href="https://stackoverflow.com/questions/40589928/append-value-to-list">Append value to List</a></p>
  
  <p>But for some reason it does not work for me.</p>
  
  <p>If I have the following code :</p>
  
  <pre><code>var myState = {
    a: {
      b: {
        c: [
          {name: 'hi', value: 2},
          {name: 'howdy', value: 3}
        ]
      }
    }
  }
  myState = Immutable.fromJS(myState);
  myState = myState.update(['a', 'b', 'c'], function (myList) {
    myList.push({"name": "hallo", "value": 4})
    }
  );
  </code></pre>
  
  <p>I get an error :</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'push' of undefined</p>
  </blockquote>
  
  <p>which indicates that the myList parameter being passed into the callback is null. </p>
  
  <p>Why is this happening?</p>
  
  <p>fiddle:</p>
  
  <p><a href="https://codepen.io/owatkins/pen/brMava" rel="nofollow noreferrer">https://codepen.io/owatkins/pen/brMava</a></p>