Skip to content

Instantly share code, notes, and snippets.

@alexmccabe
Last active January 15, 2018 10:23
Show Gist options
  • Save alexmccabe/5dd1af3a68a228ec69cbd178f4c0a25a to your computer and use it in GitHub Desktop.
Save alexmccabe/5dd1af3a68a228ec69cbd178f4c0a25a to your computer and use it in GitHub Desktop.
const { temp, pressure, humidity } = cityData.list.reduce(
(current, item) => {
current.temp.push(item.main.temp);
current.pressure.push(item.main.pressure);
current.humidity.push(item.main.humidity);
return current;
},
{ temp: [], pressure: [], humidity: [] }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment