How could I use
window.localStorage.getItem();
to specify items in localstarage that start with the string \'QQ\'
. In my case the key
You don't, get all the items and check them individually (code not tested):
var results = [];
for (i = 0; i < window.localStorage.length; i++) {
key = window.localStorage.key(i);
if (key.slice(0,2) === "QQ") {
results.push(JSON.parse(window.localStorage.getItem(key)));
}
}
If you want to do queries use something like IndexedDB.