Hacker News new | ask | show | jobs
by dkopi 3739 days ago
For-in array can be implemented using ES6's for-of. https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...

Also, Not sure if it would be correct to implement a python dict using an ES6 map. If the keys are all strings, probably better to stick to a JS object. Check out the performance difference: http://jsperf.com/es6-map-vs-object-properties/73

1 comments

For-of only works for iterable sources, it would not be a complete replacement of for...in, also it seems a bit slower that for...in as of now.. see https://kpdecker.github.io/six-speed/