I would like to get a single object that contains all the keys and values of the Localforage iteration function.
Reference: https://localforage.github.io/localForage/#data-api-iterate
localforage.setItem("Dragon Ball", "Bulma").then(function(value) {
console.log(value);
});
localforage.setItem("OnePiece", "Nami").then(function(value) {
console.log(value);
});
localforage.iterate(function(value, key, iterationNumber) {
console.log([key, value]);
})
.then(function() {
//Get all in one Object
});
Automatically translated
Simply create an empty object outside its
iterate
function and then populate it with thosekey-values
: