let journal = [..............];
//need sort by key time
function sortByStatus(){
return journal.sort(function(a, b) {
return a.fly_status - b.fly_status;
});
}
function sortByTime(){
return journal.sort(function(a, b) {
console.log( new Date( a.start_datetime).getTime() );
return new Date( a.start_datetime).getTime()
- new Date( b.start_datetime).getTime();
});
}
How can i do this logic:
journal.sortByStatus().sortByTime()
.....some other methods of array ?
I can added those methods only journal array not all array in my page ?