title: Firebase snapshot.val() returns [object Object]
body: <p>Im trying to retrieve a user from firebase DB but when I print the snapshot.val() it shows [object Object]. How can I print the real data? Thanks!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  FriendlyChat.prototype.getRandomInterlocutor = async function(){
  var numberOfUsers = await this.getNumberOfUsersRef();
  
  var randomIndex = Math.floor(Math.random() * numberOfUsers);
  if(randomIndex == 0){
    randomIndex = 1;
  }
  
  var ref = await firebase.database().ref('companies/' + this.company + '/users/');
  ref.limitToFirst(randomIndex).once('value').then(snapshot =&gt;
  {
      var user = snapshot.val();
      console.log('getRandomInterlocutor = ' + user); 
      return user;
  });
    }
  
  FriendlyChat.prototype.onAuthStateChanged = function(user) {
    console.log('entro a onAuthStateChanged');
    this.interlocutor = this.getRandomInterlocutor();
    console.log(this.interlocutor);
  }</code></pre>
  </div>
  </div>
  </p>