Let's say I have a promise p. I have the following code:
var entries = getEntries();
var getEntries = function() {
    ...SOME_CODE...
    return p.then(function(result) {
        return result;
    });
}
Using the debugger, I can see that result has the data that I want. How can I save it to the global variable entries (getEntries() currently returns an undefined value)?
