title: TypeError: Object Is Not A Function (JavaScript Chrome Storage Sync)
body: <p>This is for accessing preferences saved in chrome.storage.sync using JavaScript for a Chrome Extension.</p>
  
  <p>Code: </p>
  
  <pre><code>chrome.storage.sync.get('allWeights', function(obj) {  
            allWeights = obj.allWeights();
  
            chrome.storage.sync.get('allIDs', function(obj2) { 
              allIDs = obj2.allIDs();
              alert("ALL WEIGHTS: " + allWeights);
              alert("ALL IDS: " + allIDs);
           });
      });
  </code></pre>
  
  <p>Error: </p>
  
  <blockquote>
    <p>Error in response to storage.get: TypeError: object is not a function
        at HTMLDocument.restore_options</p>
  </blockquote>
  
  <p>And the error is pointing to the first line (chrome.storage.sync.get('allWeights').</p>
  
  <p>What is causing this error and how can I fix it? </p>