Sorting my JSON response
<pre><code>{
    "JsonResult": {
        "List": [{
            "Subject": "Something",
            "Type": 0,
            "TypeDescription": "Referral"
        }],
     }
}
</code></pre>

<p>This is my sample json response i get while hitting my service, after that i have a button which carries option like <code>Subject, Type and TypeDescription</code>. </p>

<p>How can i sort the Json Response based on the parameter i send. </p>

<pre><code>function sortItems(jsonResponse,paramater){
          var sorted =  jsonResponse.List.sort( function(a, b) {
          var nameA = a.paramater.toLowerCase(),
          nameB = b.paramater.toLowerCase();
          return nameA.localeCompare(nameB);
}
</code></pre>

<p>Here is the sort function i am using, but its not working. I already have my JSON response and i need to sort at runtime based on the argument i send.</p>
