6 ms·
I've made it a habit to check Mozilla's JS docs once in a while for functions like Flat() and FlatMap(). Sometimes if I find myself reaching for underscore/loda
by yawnxyz 5y ago
I've made it a habit to check Mozilla's JS docs once in a while for functions like Flat() and FlatMap(). Sometimes if I find myself reaching for underscore/lodash, I'll check Mozilla docs first to see if there's some new function that can let me omit using lodash.
I'm often delighted to find new convenience functions I can just use without adding another dependable.
- newsbinator 5y agoI often use Lodash’s sumBy, groupBy and orderBy. Love the versatility and one-liner aspect. E.g. sumBy(“orders”, “total.amount”)
- johndough 5y agoWhich input method are you using that double quotes are ” (U+201C) instead of " (U+0022)?
- newsbinator 5y agoWow, no clue. That was on mobile... web app or Octal (native app). Stock iOS English (US) keyboard.
- notreallyserio 5y agoNot that you have to, but just FYI you can disable "smart" punctuation in iOS Settings: General -> Keyboard -> Smart Punctuation. I don't know why they omitted the quotes around smart there.
- saranshk 5y agothere have been a lot of those added to the ES spec lately and a lot more coming soon. So it is always good to check MDN because I usually end up learning something new mostly.
- copperx 5y agoIs there a Google equivalent to MDN?
- markstos 5y agoNo.
- Osiris 5y agoLodash includes guards for all it's functions which can help avoid "Cannot call function map of undefined" and similar errors. So I still prefer using lodash map, reduce, filter, etc for that added defensiveness.
- hajile 5y agoIf you're chaining, you're still MUCH better off with Lodash. Native functions iterate once per function. Lodash uses an iterator and only loops through the list once.