title: How to create a function that sorts a numeric array and be able swap arrays on the fly?
body: <p>This is my code</p>
  
  <pre><code>        var content = [ 409, 879, 483, 465, 907, 154, 838, 847 ]//the array
  
          var result = content.sort( function( a, b ){ return a - b } )//This works
  
          alert( result )//works. But I want to be able to easily swap out arrays like below
  
          function order( ary )//this function returns undefined, why?
          {
              ary.sort( function( a, b ){ return a - b } )//order numbers from least to greatest;
          }
  
          var result = order( content );
  
          alert( result )//returns undefined
  </code></pre>
  
  <p>Not sure why my order function returns undefined, yet outside of a function that code works? I would like to allow the order function to accept any array when called. Thanks and yes I'm newbie.</p>