title: getItem localstorage containing a string
body: <p>I have multiple keys in my localstorage: <code>task-1,task-2, task-3 ...</code> I'm searching a way to get the total of the keys starting with the string "tasks-" in order to place it in my loop instead of <code>localStorage.length</code>.</p>
  
  <p>In fact if I have an other app that uses the localstorage, my loop returns me a length corresponding to ALL the keys in the localStorage, including the ones that are out of the app in question.</p>
  
  <pre><code>   i=0;
  
     if(localStorage.getItem("task-"+i) != null){
  
       for( i = 0; i &lt; localStorage.length; i++){ 
  
         console.log(i)
  
       }
    }
  </code></pre>
  
  <p>Thanks a lot for your help</p>