var group = ["a","b","c","d"]; var groupLength = group.length; while (groupLength--) { var item = group[groupLength]; if(groupLength == 0){ console.log("Last iteration with item : " + item); } }