title: Uncaught TypeError: titles.push is not a function
body: <p>I'm trying to push</p>
  
  <pre><code>titles.push(title);
  </code></pre>
  
  <p>but there's an error when I try to run it: titles.push is not a function.</p>
  
  <p>Full code:</p>
  
  <pre><code>    var title = prompt("What would you like your title to be?");
          localStorage.setItem(title, editElem.innerHTML); 
      var titles = localStorage.getItem("titles");
          if(titles == null) 
              titles = new Array();
          if(titles.indexOf(title) &lt; 0) 
              titles.push(title); 
          localStorage.setItem("titles", titles); 
      }
  </code></pre>