Skip to content

Instantly share code, notes, and snippets.

@gegeke
Created June 5, 2019 10:27
Show Gist options
  • Save gegeke/fece798e1281e17d70e7f74381c11ab6 to your computer and use it in GitHub Desktop.
Save gegeke/fece798e1281e17d70e7f74381c11ab6 to your computer and use it in GitHub Desktop.
Addition benchmarking with for...of
export const addSingle = (items, noItems) => {
return new Promise((resolve) => {
let sumData = 0
for(let item of items) {
sumData += item.data1
}
resolve(sumData)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment