script.js
// List the array into the search history sidebar
List the array into the search history sidebar
List the array into the search history sidebar
function listArray() {
    searchHistoryList.empty();
    cityList.forEach(function(city){
        var searchHistoryItem = $('<li class="list-group-item city-btn">');
        searchHistoryItem.attr("data-value", city);
        searchHistoryItem.text(city);
        searchHistoryList.prepend(searchHistoryItem);
    });
    localStorage.setItem("cities", JSON.stringify(cityList));
}
function listArray ( ) { searchHistoryList . empty ( ) ; cityList . forEach ( function ( city ) { var searchHistoryItem = $ ( '<li class="list-group-item city-btn">' ) ; searchHistoryItem . attr ( "data-value" , city ) ; searchHistoryItem . text ( city ) ; searchHistoryList . prepend ( searchHistoryItem ) ; } ) ; localStorage . setItem ( "cities" , JSON . stringify ( cityList ) ) ; }
List the array into the search history sidebar
List the array into the search history sidebar
// Empty out the elements in the sidebar // Repopulate the sidebar with each city // in the array // Update city list history in local storage