mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-18 17:49:31 -07:00
reduse use of .reduce
This commit is contained in:
@@ -57,7 +57,7 @@ class TravelForecast extends WeatherDisplay {
|
|||||||
this.data = forecasts;
|
this.data = forecasts;
|
||||||
|
|
||||||
// test for some data available in at least one forecast
|
// 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) {
|
if (!hasData) {
|
||||||
this.setStatus(STATUS.noData);
|
this.setStatus(STATUS.noData);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user