- My requirement is sorting objects based on the price.Based on the cash, objects should be sorted.
Below is the sample data which i consoled and got and showing below.
By means of consoling full_sky.sort(test); i am getting below data.
0: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 44499
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
1: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 2299
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
2: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 3399
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
Output should be something like this
1: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 2299
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
2: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 3399
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
0: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 44499
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1