title: Can't Store and Retrieve From Chrome Storage
body: <p>First of all, I apologize if this question sounds similar to others. I've done a lot of research and I guess I can't piece together my situation and issues other people have with this API.</p>
  
  <p>I am creating an chrome app that basically demonstrates the ability to store and retrieve data from the Chrome Storage API. Once I'm comfortable doing this, I can implement this in a larger application I'm making.</p>
  
  <p>However, I can't seem to get the basic app working. Here's the relevant code:</p>
  
  <p>"storage.js"</p>
  
  <pre><code>function Store(key,data) {
  
      console.log("Data: " + data);
  
      chrome.storage.local.set({ key: data }, function () {
  
          console.log("Secret Message Saved!");
  
      });
  
  }
  
  function Retrieve() {
  
      chrome.storage.local.get(function (data) {
  
          console.log("The data stored is:" + data);
  
      });
  
  }
  </code></pre>
  
  <p>"master.js" (main script)</p>
  
  <pre><code>var myKey = "secretMessage";
  var myData = "Pssst!";
  
  Store(myKey, myData);
  
  Retrieve(myKey);
  
  console.log("Done!");
  </code></pre>
  
  <p>I'm at a loss. The output I get is:</p>
  
  <pre><code>Data: Pssst!
  Done!
  Secret Message Saved!
  The data stored is:[object Object]
  </code></pre>
  
  <p>It appears that either I'm storing wrong or retrieving wrong.</p>
  
  <p>I've looked through the documentation. Maybe I'm just not understanding the concept of the API and what it is able to store and retrieve. I'm fairly new to coding in the javascript language. Any help would be much appreciated!</p>
  
  <p>Thanks!</p>