The sort function is established to sort the array.
var record = new Record([ {"data1":"hello world", "data2":123, "data3":new Date("2016/12/13") }, {"data1":"hello human", "data2":456, "data3":new Date("2016/12/14") } ]); record.sort("data2","asc");
Calling | Returning |
---|---|
record .sort ( field , action ) | Record |
Parameters | Type | Description |
---|---|---|
field | String | The field name of the array. |
action | eq|gt|lt|like|!eq|!gt|!lt|!like | The comparison action. |
value | String|Number|Date|Boolean | The value to compare. |