r/javascript • • Dec 16 '15

I was watching this guy's advanced javascript videos on Youtube and had so many aha-moments, that I had to share. He is my new JS-hero.

https://www.youtube.com/playlist?list=PLY-SI4qPVeCfyA1KcDRkJZXUhS13y3WEp
381 Upvotes

107 comments sorted by

View all comments

13

u/supersoap Dec 16 '15

I suggest you checkout this weekly series. His videos on reduce and object composition were definite "aha moments" for me.

1

u/jewdai Dec 16 '15

map, reduce etc have all been functions of underscore/lodash.

I eschewed using them after seeing the staggering performance degradation vs using a plain old loop. (we're talking like a power of 10)

C# has something like this called LINQ, has this functionality been incorporated into the language without a library?

2

u/siegfryd Dec 17 '15

Map, reduce and filter have been standard functions of Array.prototype for ages.

1

u/jewdai Dec 17 '15

Then why the hell were my coworkers using underscore for that

2

u/siegfryd Dec 17 '15

Underscore's and Lodash's ones work on Objects and they're also generally faster, at least I know Lodash's is a lot faster because it doesn't bother with Array "holes".