Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findByQuery(query) {
- let i, results = [];
- for (i in window.localStorage) {
- if (window.localStorage.hasOwnProperty(i)) {
- if (i.match(query) || (!query && typeof i === 'string')) {
- results.push(i);
- }
- }
- }
- return results;
- }
- console.log(findByQuery('test'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement