assets/js/script.js
// execute getWeather function then add it to the search history
execute getWeather function then add it to the search history
execute getWeather function then add it to the search history
function searchCity() {
  var cityName = inputEl.val();
  getWeather(cityName);
  searchHistory.unshift(cityName);
  searchHistory = searchHistory.slice(0,5);
  localStorage.setItem("search",JSON.stringify(searchHistory));
  generateHistory();
}
function searchCity ( ) { var cityName = inputEl . val ( ) ; getWeather ( cityName ) ; searchHistory . unshift ( cityName ) ; searchHistory = searchHistory . slice ( 0 , 5 ) ; localStorage . setItem ( "search" , JSON . stringify ( searchHistory ) ) ; generateHistory ( ) ; }
execute getWeather function then add it to the search history
execute getWeather function then add it to the search history