I am having trouble grasping the difference between the two. I tried downloading the library and there was no code. I am trying to build a basic slider along with other basic functions I have built in jQuery. Any help, tutorials, plugins and information would be very helpful!
5 companies reportedly use Vanilla. JS in their tech stacks, including HHEY, Picomto, and Labinator.
You would be surprised but Vanilla js is extremely faster than other JavaScript frameworks. So you can say that it provides better performance than leading front-end frameworks.
jQuery has been around for over 10 years, which is a long time for a code library. It's still one of the most popular JavaScript libraries in web development.
"Vanilla JS" refers to plain, unmodified JavaScript.
document.getElementById('myelement').innerHTML = "I was written with JavaScript!";
jQuery is a collection of functions and stuff that are intended to make it easier to write JavaScript (although personally I feel it makes it more like spaghetti)
$("#myelement").html("I was written with jQuery!");
Since jQuery is just a bunch of JavaScript, plain JavaScript is ALWAYS faster to run. It may be harder to write because you have to actually think about what you're doing, but it will run faster than the same thing in jQuery.
For a comparison of the two code samples above, see this JSPerf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With