Skip to content

Instantly share code, notes, and snippets.

@mornir
Created February 28, 2018 19:51
Show Gist options
  • Save mornir/dfa2e33db23254f35d3f7ae45c643f90 to your computer and use it in GitHub Desktop.
Save mornir/dfa2e33db23254f35d3f7ae45c643f90 to your computer and use it in GitHub Desktop.
Use_Cases for reduce
const javDetails = detailsList.reduce((acc, detail) => {
let key = detail.childNodes[0].textContent
let value = detail.childNodes[1].textContent
return { ...acc, [key]: value }
}, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment