How to sort a JSON object in javascript or jquery with the following format
<pre><code>"attributes": [
    "BytesServed",
    "Duration",
    "UniqueIPAddresses",
    "StopEvents",
],
"rows": [
    [
        "12118931578714",
        "160557966.305",
        "372",
        "193381",
    ],
    [

        "248313315029",
        "4628315.959",
        "350",
        "27352",

    ],
]
</code></pre>

<p>I have 2 arrays, where the first array has keys and the second array is a multi-dimensional array with values. </p>

<p>Is there any pre-defined function in Javascript or jQuery which will give me the values in descending order by passing a key?</p>

<p>I have a solution, but I feel that it is a more costly approach. If anybody has better solution please let me know.</p>

<p>My current solution is -- get the index from the first array and loop through the second array and create a temporary array and then sort that temp array and use it. </p>
