This a thousand times, I know with $.trim it will use trim() for good browsers and then whatever hack effort was necessary for IE8. It would be devastating to have to write this manually.
Exactly. "No one wants to write their own feature detection code" is the whole point of jQuery.
You hit the nail on the head.
Or you could use the class list polyfill.
Re:You Don't Need JQuery
by organsnyder on Wednesday December 17, 2014 @12:19PM
(#8763118)
If that's all you need, then that would be fine. However, for most projects you end up needing many other such polyfills, to the point that you might as well use one library—jQuery—to provide them all (plus a lot of other functionality).
If the point of that website was to educate people on the apis that jQuery calls under the hood, it chose a really poor name.