How can I reverse the order of data in the "forEach" loop so that the latest date is displayed first instead of the oldest to newest?
var json = {
// JSON data goes here
}
json.TrackingRecord.MovementInformation.Movement.reverse().forEach(function(item) {
//console.log(item);
item.MovementDate = moment(item.MovementDate).format('ddd, Do of MMM YYYY');
item.MovementTime = moment(item.MovementTime).format('hh:mm a');
$("#movement tbody").prepend("<tr><td>" + item.MovementDate + "</td><td>" + item.MovementTime + "</td><td>" + item.Description + "</td></tr>");
})
<script src="https://cdn.jsdelivr.net/momentjs/2.11.2/moment.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<table id="movement">
<thead>
<tr>
<th>Date</th>
<th>Time</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</tbody>
</table>