At some point you'll need lodash and co again - at least for convinience.
At some point you'll need lodash and co again - at least for convinience.
There's a strawman proposal out there to solve this but until then I'll be sticking with Lodash: https://github.com/leebyron/ecmascript-iterator-hof
[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
for (var key of Object.keys(imps)) { }
I figured that would work with babel-2015 and it did work on Chrome and Safari but on Firefox visitors were getting:
Symbol.Iterator undefined
You need http://babeljs.io/docs/plugins/transform-es2015-for-of/ as well.
So there is much less risk in using _.each(imps, (value, key) => and not having to discover what you don't know.
I also added Firefox to the unit tests after that.
>Important: Note that the native equivalents are array methods, and will not work with objects. If this functionality is needed, then Lodash/Underscore is the better option.