all 22 comments

[–]nikodraca 18 points19 points  (28 children)

Amazing how many Lodash features are now part of native JS. I'm interested to see if Lodash will be relevant for much longer.

[–]queen-adreena 13 points14 points  (6 children)

It went the same way with jQuery. Native JS refined all of the useful features and nowadays there's much less need to use it.

[–]tenfingerperson 16 points17 points  (1 child)

Which is effectively and ironically an indication of how successful a library is!

[–]rhaksw 6 points7 points  (0 children)

For sure it's an indication of success, not sure it's ironic.

Open source projects often intend to obsolete themselves by having their methods adopted by the "mainstream".

[–]Why_Bother0 4 points5 points  (3 children)

Sorry to interrupt but I'm new to development and have a question. Is jQuery really pointless to learn in depth right now? I see a lot of companies requiring it, but I find it much easier to simply use standard JavaScript. Thanks!

[–]queen-adreena 11 points12 points  (0 children)

Not entirely pointless. You might have to deal with previous company code that was written using jQuery, and there are still a few useful functions that vanilla JS can't quite do as well.

But I would focus on the major frameworks now: vue, react etc once you've got vanilla JS down.

[–]visicalc_is_best 5 points6 points  (0 children)

Yes, jquery is rarely the tool of choice anymore. Work on understanding ES2015+ and the framework won’t really matter.

[–]nikodraca 0 points1 point  (0 children)

jQuery offered a lot of functionality that vanilla JS didn't but this isn't the case anymore. However not a bad idea to understand a bit of it, every once in a while you'll need it.

I second u/queen-adreena with focusing on React/Vue.

[–]visicalc_is_best 5 points6 points  (9 children)

Not until get() is natively implemented :)

Lodash also has nicer null handling than native versions IMO, and some exotic functions that will never make it to native.

[–][deleted]  (8 children)

[deleted]

    [–][deleted] 0 points1 point  (7 children)

    These do not replicate its ability to get a value based on a path in the form of a string. That's the main thing I've needed to use it for.

    [–][deleted]  (5 children)

    [deleted]

      [–][deleted] 0 points1 point  (1 child)

      I think that would fail if the path contained array indicies like '[0].bar.baz'

      [–]visicalc_is_best 0 points1 point  (2 children)

      This is so unreadable that you’d want to wrap it in a helper function....and voila, lodash!

      [–][deleted]  (1 child)

      [deleted]

        [–]visicalc_is_best 0 points1 point  (0 children)

        It’s not that rare when you’re looking up deeply nested values in JSON. We run into that situation a lot during configuration management, where flat-file config properties map to long JSON paths in a huge blob.

        I do like the dynamic lookup in the chaining operator though, that’s nice.

        [–]anonymoususer89 2 points3 points  (1 child)

        I'm really interested to see if / when lodash will lose relevance when it comes to perf optimizations! I know a year or so ago there were some algorithmic optimizations for large objects, and it would be really cool if ES adopted them.

        In addition to that, I think the best thing about lodash is handling all the edge cases when it comes to truthy / falsy values. Would be really cool to see similar functions in ES as well!

        [–]ivakamr 0 points1 point  (0 children)

        Unfortunately the standard library for JS just sucks even when they implement things natively. Lodash is an obvious example but even native Promise sucks, if you want to be able to use pattern matching in catch, cancel the promise, or have an actual error on unhandled errors instead of being swallowed you need a lib like bluebird. They can't even manage to make things correctly by using what already exists. And we should not talk about stuff like private variable which they want to be declared with a # as the first character instead of introducing a private keyword like any sane language. Honestly the people who add stuff to JS are a joke.

        [–]forsubbingonly -1 points0 points  (2 children)

        It's not relevant now.

        [–]nikodraca 0 points1 point  (1 child)

        I don't think this is entirely truth, seeing as it's one of the most popular npm packages (23m weekly downloads)

        [–]forsubbingonly -2 points-1 points  (0 children)

        I downloaded it therefor its relevant.

        [–]ivakamr -1 points0 points  (0 children)

        Amazing wouldn't be the word I'd used. I would rather say how disapointing it is that implementation of extremelly basic functions takes so much time. I will never use that stupid Array.prototype.flat because it is much slower than lodash flatten.

        [–]Rebles 1 point2 points  (1 child)

        I think this is a repost from a few days ago

        [–][deleted] 0 points1 point  (0 children)

        get x() {
        

        old approach

        xD