0

Emm..I have a sample example, which having Object with Arrays,

Lets Consider

obj = {
 code:[1001, 1002, 1003, 1004, ..etc],
 name:['John', 'Kerry', 'Stepen', 'Mery', ..etc],
 priority:[20, 40, 10, 30, ..etc] //containing more than 10000 elements in an array
}

Expected Output:

obj = {
 code:[1003, 1001, 1004, 1002, ..etc],
 name:['Stepen', 'John', 'Mery', 'Kerry', ..etc],
 priority:[10, 20, 30, 40, ..etc] //Sort on Priority basis
}

Could any one have simple & faster way of sorting for this kind of pattern?

Thanks & Regards Niks

Niks Jain
  • 1,617
  • 5
  • 27
  • 53
  • Yes..all arrays are related..& wanna sort on the basis of priority. – Niks Jain Nov 03 '14 at 07:01
  • 2
    Too bad it's closed now. Anyway here is maybe better answer then any of the from the duplicated question: http://jsfiddle.net/da2nyohh/1/ – dfsq Nov 03 '14 at 07:24
  • @dfsq You can always submit that as an answer to the other question. – nbrooks Nov 03 '14 at 07:30
  • @nbrooks I know, but this answer targets this specific question, don't feel like rewriting it for other one. So I will just leave it here, maybe OP will see it and it will help him. – dfsq Nov 03 '14 at 07:45

0 Answers0