title: Sort Array by String
body: <p>Right now, I have a list of streams, and I want to push streams with the string "online" to the front of the array, but I want to do this very quickly. I know I can just duplicate the array value by value and push the online values to the front, but I was wondering if there is a better way to do this.</p>
  
  <p>This is just some sample code but it is similar to what I have going. How can I just rearrange my array to push online toward the front? I'm open to JavaScript or jQuery answers.</p>
  
  <pre><code>var streams = new Array('online', 'offline', 'online', 'offline', 'online', 'offline', 'offline', 'online');
  </code></pre>