SHARE
TWEET

Untitled

a guest Mar 19th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function findByQuery(query) {
  2.     let i, results = [];
  3.     for (i in window.localStorage) {
  4.         if (window.localStorage.hasOwnProperty(i)) {
  5.             if (i.match(query) || (!query && typeof i === 'string')) {
  6.                 results.push(i);
  7.             }
  8.         }
  9.     }
  10.     return results;
  11. }
  12.  
  13. console.log(findByQuery('test'));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top