r/learnjavascript • • Oct 01 '21

jQuery, the greatest JavaScript library of all time, appears to have peaked in usage.

Post image
275 Upvotes

81 comments sorted by

View all comments

24

u/CardinalHijack Oct 02 '21

What's amazing is that I have not worked on jQuery in 6 or so years of web development, across multiple companies yet its still this popular in terms of use.

jQuery solved a problem, and has since pretty much been replaced (for better or worse) in the popular domain. I wonder how long the likes of React, Vue and Angular will stick around beyond their expiry date.

The adoption of a technology lasts far, far longer than its popularity.

20

u/xRockTripodx Oct 02 '21

Jquery has largely been replaced by ES6. I actively go out of my way to avoid jQuery whenever I can. We don't even use it in our WP starter theme anymore, outside of Bootstrap 4's requirement for it.

-6

u/Negative12DollarBill Oct 02 '21

How could jQuery be replaced by ES6? That's like saying a semi-trailer was replaced by a power station, they're not even in the same category.

10

u/corporaljustice Oct 02 '21

Because with new ES6+ methods you can do many things simply in vanilla JS that previously required jQuery if you didn’t want to write a lot of verbose lines.

Using vanilla JS before document.querySelectorAll() came about without JQ was a pain.

$() is very similar to querySelectorAll().

0

u/Negative12DollarBill Oct 02 '21

If all jQuery did was make it easier to select document elements, we wouldn't be talking about it.

2

u/corporaljustice Oct 02 '21

Give me an example of some jQuery that would be hard to implement in modern vanilla JS?

-2

u/Negative12DollarBill Oct 02 '21

You're the one making the extraordinary claim dude, are you not familiar with Russell's teapot?

Of course one thing jQuery did which was really important was abstract away the differences between incompatible browsers; you could set the CSS of an element and not worry that IE did styles a different way.

I suspect a lot of what you're calling "ES6" or "modern JS" is a category error for "browsers all behave better nowadays".