I read couple posts about the closure in loop but still not really get it how to apply to my situation.

I have three feed urls defined in HTML and using JavaScript promise to return the response when it's ready without blocking the UI. I am able to get two blog entries data per feed url. Now, each returned blog entry has its published date and I would like to sort them from latest to oldest. However, I keep getting the last value when I pushed the object to array. I know this is something to do with closure and since I'm not familiar with closure, I have difficulty to solve this problem. Any help is great appreciated!

```
var itemArray = [];
var entryObj = {};

promise.then(function (response) {
    var parser = new DOMParser();
    xml = parser.parseFromString(response, "text/xml");
    var items = xml.getElementsByTagName("item");

    for (var x = 0; x < items.length && x < limits; x++) {
       title = items[x].getElementsByTagName("title")[0].innerHTML;
       link = items[x].getElementsByTagName("link")[0].innerHTML;
       pubDate = items[x].getElementsByTagName("pubDate")[0].innerHTML;
       creator = items[x].getElementsByTagNameNS("http://purl.org/dc/elements/1.1/", "creator")[0].innerHTML;

       entryObj.title = title;
       entryObj.link = link;
       entryObj.pubDate = pubDate;
       entryObj.creator = creator;

       itemArray.push(entryObj);

       // output: all 6 objects contain last value
       console.log(itemArray);
    }
});

```