包含多个数组的对象排序:JavaScript

时间:2014-11-03 06:50:50

标签: javascript sorting

Emm ..我有一个示例示例,其中包含Object with Arrays,

让我们考虑一下

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
}

预期产出:

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

任何人都可以简单吗?对这种模式进行快速排序的方法是什么?

谢谢&问候 NIKS

0 个答案:

没有答案