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

4
  • Yes..all arrays are related..& wanna sort on the basis of priority. Commented Nov 3, 2014 at 7:01
  • 2
    Too bad it's closed now. Anyway here is maybe better answer then any of the from the duplicated question: jsfiddle.net/da2nyohh/1 Commented Nov 3, 2014 at 7:24
  • @dfsq You can always submit that as an answer to the other question. Commented Nov 3, 2014 at 7: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. Commented Nov 3, 2014 at 7:45

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.