function cityButtons(response) {
    var cityHistory = [];
    if (storedCities.indexOf(response.name) === -1) {
      cityHistory.push(response.name);
      storedCities.unshift(response.name);
      sessionStorage.setItem("history", JSON.stringify(storedCities));
    }
    searchBar.val("");
    for (var i = 0; i < cityHistory.length; i++) {
      var newDiv = $("<div>");
      newDiv.append(
        $(
          "<button type='button' class='btn btn-light cityButton my-1 py-3 text-start col-sm-9'>" +
            cityHistory[i] +
            "</button>"
        )
      );
      $("#savedCities").prepend(newDiv);
    }
  }
// Creates Buttons for quick search based off of search history - Nests in each of the API functions
Creates Buttons for quick search based off of search history - Nests in each of the API functions
Creates Buttons for quick search based off of search history - Nests in each of the API functions
function cityButtons(response) {
    var cityHistory = [];
    if (storedCities.indexOf(response.name) === -1) {
      cityHistory.push(response.name);
      storedCities.unshift(response.name);
      sessionStorage.setItem("history", JSON.stringify(storedCities));
    }
    searchBar.val("");
    for (var i = 0; i < cityHistory.length; i++) {
      var newDiv = $("<div>");
      newDiv.append(
        $(
          "<button type='button' class='btn btn-light cityButton my-1 py-3 text-start col-sm-9'>" +
            cityHistory[i] +
            "</button>"
        )
      );
      $("#savedCities").prepend(newDiv);
    }
  }
function cityButtons ( response ) { var cityHistory = [ ] ; if ( storedCities . indexOf ( response . name ) === - 1 ) { cityHistory . push ( response . name ) ; storedCities . unshift ( response . name ) ; sessionStorage . setItem ( "history" , JSON . stringify ( storedCities ) ) ; } searchBar . val ( "" ) ; for ( var i = 0 ; i < cityHistory . length ; i ++ ) { var newDiv = $ ( "<div>" ) ; newDiv . append ( $ ( "<button type='button' class='btn btn-light cityButton my-1 py-3 text-start col-sm-9'>" + cityHistory [ i ] + "</button>" ) ) ; $ ( "#savedCities" ) . prepend ( newDiv ) ; } }
Creates Buttons for quick search based off of search history - Nests in each of the API functions
Creates Buttons for quick search based off of search history - Nests in each of the API functions