Skip to content

Instantly share code, notes, and snippets.

@gegeke
Last active June 5, 2019 10:15
Show Gist options
  • Select an option

  • Save gegeke/dd16d72c8a548b988d50ef9b929d612a to your computer and use it in GitHub Desktop.

Select an option

Save gegeke/dd16d72c8a548b988d50ef9b929d612a to your computer and use it in GitHub Desktop.
Addition benchmarking using forEach()
export const addSingle = (items, noItems) => {
return new Promise((resolve) => {
let sumData = 0
items.forEach(item => { sumData += item.data1 })
resolve(sumData)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment