title: Sorting arrays using React js
body: <p>I am attempting to display array values sorted by <code>OrderId</code> field. Here is my code:</p>
  
  <pre><code>var fields = 
      [{value: "Claims", OrderId:3 },
       {value: "Requests", OrderId:1 },
       {value: "Access", OrderId: 2}]
  
  var listElements = fields.sort('OrderId', function(n){ return Math.sin(n) } )
      .map( function(field) {
          return React.createElement('li', {},
              React.createElement('h2',{}, field.value)
  
          )
      })
  var rootElement =
      React.createElement('div', {},
          React.createElement('ul', {}, listElements)
  
      )
  
  ReactDOM.render(rootElement, document.getElementById('container')); 
  </code></pre>
  
  <p>This does not give me errors and displays the values in a desired format but unsorted... How can I sort in Reactjs world?</p>