title: How to check if a variable is set on chrome storage
body: <p>I have a little snippet working with LocalStorage but I cannot make it work on Chrome Storage scheme yet.</p>
  
  <p>When my application starts I check a variable in localStorage </p>
  
  <pre><code>var bookNarration=parseInt(localStorage.getItem("narration"));
  </code></pre>
  
  <p>If that variable is undefined, it means that my app has been opened for the first time and I after handle bookLanguage in a switch using the "default" declaration. </p>
  
  <pre><code>switch(window.bookNarration)
    {
      case 2:
          window.narrationShift = window.spanishShift;
      break;
      case 3:
          window.narrationShift = window.frenchShift;
      break;
      case 10:
          window.narrationShift = window.neutralShift;
      break;
      default:
          window.narrationShift = 0; }
  </code></pre>
  
  <p>To make it work with Chrome Storage I change my code on this way:</p>
  
  <pre><code>var bookNarration=parseInt(chrome.storage.local.get("narration"));
  </code></pre>
  
  <p>But I immediately get this error: </p>
  
  <blockquote>
    <p>Invocation of form get(string) doesn't match definition get(optional string or array or object keys, function callback)</p>
  </blockquote>
  
  <p>I have been searching for many hours trying to find a solution but I can't make it work. I thing that I just need to check if the value is already defined so if It isn't, I could use set() method to store my default value.</p>