jQuery vs vanilla JavaScript - Beau teaches JavaScript

preview_player
Показать описание
When should you use jQuery instead of vanilla JavaScript? Is jQuery still relevant? What is jQuery good for? Find out in this video!

-

⭐JavaScript Tutorials Playlists⭐

-

Рекомендации по теме
Комментарии
Автор

I wrote a hundred lines of jQuery yesterday (including comments), then decided to use vanilla js instead. It took me 170 lines to write the same functionality. (NB: My vanilla js was slightly more efficient code because it was the second time I wrote the same app, so I had refactored some stuff). So I'd estimate the jQuery probably had about half the lines of code overall. The main reason why the jQuery was slightly leaner (in terms of lines of code) was because of the ability to chain statements together, rather than reselecting elements.


I think jQuery has a slight advantage in terms of readability... but it's not a big deal.


In my case, jQuery is probably still the best option, because I'm likely going to want to use jQuery UI as the app develops. Otherwise I'd have to rewrite some of the same functionality jQuery UI provides.


As with everything, I guess it all depends on what you need to do. If all you are doing is basic web enhancement stuff, vanilla js is perfectly fine. But the more you go beyond that, the more you appreciate out of the box solutions...


I think it's great though that js is evolving into a leaner and more powerful scripting language. And when you combine it with CSS3, you've really got a lot more power and flexibility than we had previously.

AndyJMacLeod
Автор

love it! very clear explanation, please do more vanilla javascript videos

wirandhikablogs
Автор

So cool the pollyfil tip. So cool, so cool! I didn´t know about that really will make me more happy code js on future projects! I am a fan of vanilla js!

tiagogomes
Автор

When you say to place that polyfill script tag at the top of your website, where exactly do you mean? In the head of the document? Does it matter what comes before or after it?

jasonwelsh
Автор

Great course, thank you!
Tutorials in proper English are SO underrated!!

teoi
Автор

Thank you so much, Beau. I like your slogan "Use your code for good", sounds like we, developers, have the power to make things good (and bad)

buithutruc
Автор

i am doing this usually

function $(selector) {
let elems =
return elems.length > 1 ? Array.from(elems) : elems[0];
}

let elem = $('.someClass');

bagaswahyuhidayah
Автор

Thank you. Personally, I like jquery chained way to express a solution

RuloKobashikawa
Автор

I learn bootstrap and jquery in college, but i don't like both of them. Vanilla ftw!

iMakeOnionsCry
Автор

There are a lot of other jquery methods you didn't mention which is much harder to implement in plan js. For example, find and close, do they exist in plain js?

TarekFaham
Автор

What about siblings and slideToggle? Is there alternatives in vanilla js?

wswebus
Автор

Isn't it common do use a $ sign infront of vannilla queryselector variables aswell ?

busherinolol
Автор

so finally what's bad about using JQuery? it's clear that JS is almost as good as JQuery, but what are the exact reason why should i use the less convenient way?

Автор

Should "var" still be used? That's something that I still wonder myself. I mean in production.

sergi
Автор

I like doing this:
const doc = document, get = "querySelector";

doc[get](".selector")

trappedcat
Автор

var gdI =
var an_el = gdl('an_id');

davidk
Автор

how do I convert jquery to vanilla javscript?

karlrussellmenil
Автор

I have a problem with the requestAnimationFrame() thing. I have an element with a class of '.other-div' and I set the original state to the same state as you did in the CSs (opacity and display and gave it a transition property). I have a button on the button and I am trying to make the element fade in using this method and it is not working. Can anyone help please?
const output =
const otherDiv =
const btn =

btn.onclick = () => {
otherDiv.style.display = 'block';
requestAnimationFrame = ( () => otherDiv.style.opacity = 1);
};

jasonwelsh
Автор

What percentage Javascript cover Jquery in?

arcanelore
Автор

I still like jQuery after the video :)

danielszalok
join shbcf.ru