app/js/dbhelper.js
/**
   * Fetch all neighborhoods with proper error handling.
   */
Fetch all neighborhoods with proper error handling.
Fetch all neighborhoods with proper error handling .
static fetchNeighborhoods(callback) {
    DBHelper.fetchRestaurants((error, restaurants) => {
      if (error) {
        callback(error, null);
      } else {
        const neighborhoods = restaurants.map((v, i) => restaurants[i].neighborhood)
        const uniqueNeighborhoods = neighborhoods.filter((v, i) => neighborhoods.indexOf(v) == i);
        callback(null, uniqueNeighborhoods);
      }
    });
  }
static fetchNeighborhoods ( callback ) { DBHelper . fetchRestaurants ( ( error , restaurants ) => { if ( error ) { callback ( error , null ) ; } else { const neighborhoods = restaurants . map ( ( v , i ) => restaurants [ i ] . neighborhood ) const uniqueNeighborhoods = neighborhoods . filter ( ( v , i ) => neighborhoods . indexOf ( v ) == i ) ; callback ( null , uniqueNeighborhoods ) ; } } ) ; }
Fetch all neighborhoods with proper error handling.
Fetch all neighborhoods with proper error handling .
// Fetch all restaurants
 // Get all neighborhoods from all restaurants
 // Remove duplicates from neighborhoods
