title: Firebase: How to extract values from snapshot object?
body: <p>I am new in Firebase an am having a bad time trying to extract properties from snapshot object. As by the documentation, I should be able to pick directly the contents of the object this way:</p>
  
  <pre><code>snapshot.val().property_name
  </code></pre>
  
  <p>However, every time I try to do that I get an 'undefined' value.
  Yes, I know that the name is correct and that the property has contents.</p>
  
  <p>If I do this:</p>
  
  <pre><code>MyRoom.update({Marker1:'foo'});
  
  MyRoom.on('child_added', function(snapshot)
  {
     alert(snapshot.name()); // it returns Marker1
     alert(snapshot.val());  // it returns foo
  });
  </code></pre>
  
  <p>But if instead I try:</p>
  
  <pre><code>MyRoom.update({Marker1:'foo'});
  
  MyRoom.on('child_added', function(snapshot)
  {
     alert(snapshot.val().Marker1); // it returns undefined
  });
  </code></pre>
  
  <p>What am I doing wrong?</p>