const re = /[a-zA-Z]/g; Object.keys(localStorage).forEach(function (key) { if (key.match(re)) { //do something } });
for (const [key, value] of Object.entries(localStorage)) { console.log(`${key}: ${value}`); }