title: How can I revert the order of a list that I generate based on numbers that I get from Firebase?
body: <p>I have a list of numbers in Firebase that goes from 1 to X number, since it increases every so often... The list is generated without problems, but it is generated downwards, that is, in this way:</p>
  
  <pre><code>1
  2
  3
  4
  5
  ...
  </code></pre>
  
  <p>What I need is that it be generated in this way:</p>
  
  <pre><code>...
  5
  4
  3
  2
  1
  </code></pre>
  
  <p>I have tried adding reverse everywhere but it has not worked ...</p>
  
  <p>This is the code I am using:</p>
  
  <pre><code>var content = '';  
            firebase.database().ref().child("Users").on('value', function(snapshot){
            if(snapshot.exists()){
              //console.log(snapshot.key)
              content ='&lt;ul&gt;';  
              snapshot.forEach(function(data){
                  var val = data.val();
  
                  content += '&lt;li&gt;' + val.Usuario + '&lt;/li&gt;';
  
              });
              content +='&lt;/ul&gt;';
  
              $("#A_Usuarios")append(content);
              }
              });
  </code></pre>
  
  <p>This is the structure of the db</p>
  
  <p><a href="https://i.stack.imgur.com/vhR6p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vhR6p.png" alt="enter image description here"></a></p>
  
  <p>I hope you can help me, thank you very much!</p>