How can we check for the last iteration of a jQuery.each()
loop? My loop is iterating on an object coming from a $.ajax
request.
jQuery.ajax({
url: "<?php echo $this->getUrl('xs4arabia/index/getFetchrOrderLogs/'); ?>",
type: "GET",
data: {
tracking_id: tracking_id
},
dataType: "json",
success: function(data) {
jQuery.each(data, function(key, value) {
console.log(value);
})
}
});