src/batoh.js
function(storeName, cb) {
    var result;
    var transaction = this.transaction(storeName, MODE.READ_ONLY, result, cb);
    var store = this.store(storeName, transaction, cb);
    var request;
    try {
      request = store.count();
    } catch (err) {
      if (isFunction(cb)) return cb(err);
    }
    request.onsuccess = function(event) {
      result = event.target.result;
    };
    request.onerror = function(event) {
      if (isFunction(cb)) return cb(event.target.error);
    };
  }
function(storeName, cb) {
    var result;
    var transaction = this.transaction(storeName, MODE.READ_ONLY, result, cb);
    var store = this.store(storeName, transaction, cb);
    var request;
    try {
      request = store.count();
    } catch (err) {
      if (isFunction(cb)) return cb(err);
    }
    request.onsuccess = function(event) {
      result = event.target.result;
    };
    request.onerror = function(event) {
      if (isFunction(cb)) return cb(event.target.error);
    };
  }
function ( storeName , cb ) { var result ; var transaction = this . transaction ( storeName , MODE . READ_ONLY , result , cb ) ; var store = this . store ( storeName , transaction , cb ) ; var request ; try { request = store . count ( ) ; } catch ( err ) { if ( isFunction ( cb ) ) return cb ( err ) ; } request . onsuccess = function ( event ) { result = event . target . result ; } ; request . onerror = function ( event ) { if ( isFunction ( cb ) ) return cb ( event . target . error ) ; } ; }
Count the objects in the store.

@param {String} storeName - name of the object store to count.
@param {Function} callback - gets one argument `(err)`,
if there is no error `err` is null.
Count the objects in the store .