title: Store a function in IndexedDb datastore
body: <p>Is it possible in any way to store a function in an IndexedDB datastore? I have done some searching and found nothing on the data types that IndexedDB supports. I tried simply adding a function and the instance of a function to an object store as follows, but it didn't work.</p>
  
  <pre><code>var myclass = function () {
      self = this;
      self.name = 'Sam';
      self.hello = function () {
          console.log('Hello ' + self.name);
      };
  }
  
  var transaction = db.transaction(['codeobject'], 'readwrite');
  var store = transaction.objectStore('codeobject');
  var request = store.put({ 'classname': 'someclass', 'object': myclass });
  </code></pre>
  
  <p>And I have tried.</p>
  
  <pre><code>var request = store.put({ 'classname': someclass', 'object': new myclass() });
  </code></pre>
  
  <p>I would really like to be about to store a class in object db. Even if I had to store it as some type of blob and then serialize it back into a function on its way out.</p>
  
  <p>Thank you</p>