I was looking at a perf benchmark of Object.keys + forEach vs for-in with normal objects.
Object.keys
forEach
for-in
This benchmark shows that Obj
Obj
And for the ES6 fans out there, looks like
Object.keys(obj).reduce((a,k) => {a += obj[k]; return a}, res)
is by far the fastest.
https://jsperf.com/for-in-vs-for-of-keys-vs-keys-reduce