i have an array of objects which is shown below
[
0: {name: "CMT", priority: 2}
1: {name: "CDR BILLING", priority: 1}
2: {name: "POOL DATA", priority: 5}
3: {name: "FFM", priority: 3}
4: {name: "SMPP", priority: 6}
5: {name: "OTC", priority: 4}
];
how to sort this array such that the elemet having priority 1 shoould be at 0 index.What i want to achieve is
[
0: {name: "CDR BILLING", priority: 1}
1: {name: "CMT", priority: 2}
2: {name: "FFM", priority: 3} .....and so on
];