r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

19

u/zephyrtr May 28 '19

Reduce. A many to one relationship is way more verbose to manage without it.

4

u/ThatSpookySJW May 28 '19

Also all those nifty higher order functions like map, sort, and filter

0

u/[deleted] May 29 '19

[deleted]

1

u/zephyrtr May 29 '19

Well at least they filtered before they mapped, but yes that grinds my gears. Especially since it's so easy to rewrite: if (filterFunc(item)) accumulator.push(mapFunc(item)); return accumulator;