reduse use of .reduce

This commit is contained in:
Matt Walsh 2023-01-06 16:18:33 -06:00
parent 3743c45de6
commit b6e57e8a19

View file

@ -57,7 +57,7 @@ class TravelForecast extends WeatherDisplay {
this.data = forecasts;
// test for some data available in at least one forecast
const hasData = this.data.reduce((acc, forecast) => acc || forecast.high, false);
const hasData = this.data.some((forecast) => forecast.high);
if (!hasData) {
this.setStatus(STATUS.noData);
return;