JavaScript vs jQuery | Difference between JavaScript and jQuery

Published: 02 April 2022
on channel: WebStylePress
7,183
86

Where is JavaScript and where is jQuery? JavaScript is right there in every web browser. You do not have to link it or anything to use it. Use script tag in HTML, type JavaScript code in it and it will work in browser. JavaScript is supported by web browsers. You can also use console in dev tools to test run javascript code. jQuery can be downloaded from it's official website and can be linked in HTML page. jQuery can also be linked by using CDN link. jQuery does not work on it's own. To use jQuery, you have to select an element and apply function from available jQuery functions to make something happen. To write JavaScript code. Type it in between script tags in HTML. But to use jQuery, link jQuery and type additional JS code below it, in a separate JS file or in script tags.

JavaScript is a high level, multi paradigm, weakly typed, interpreted client-side scripting programming language used to make websites more responsive and interactive. jQuery is an open-source cross-platform JavaScript library that simplifies the interactions between web pages. It is widely famous for its philosophy of "Write less, do more". JavaScript uses JIT (Just in Time Compiler) which is a combination of Interpreter and Compiler and is written in C. It's a combination of ECMA script and DOM. DOM is Document Object Model. JQuery has only the DOM.

JavaScript is not confined to websites development only. It is also used in many desktop and server programs. JavaScript can be used for client side and server side. Node.js is the best example. Some databases, like MongoDB also uses JavaScript. jQuery usage is limited to web development. It had been used for a mobile development. But it's use case has been decreased to almost zero because we have other libraries and frameworks that can do a better job at mobile development: like React Native, Xamarin, Ionic, Flutter, Swift. Best use case for jQuery is small apps and websites under web development category.

jQuery has it's limits and can not be used in large scale projects. Large scale projects demand speed, efficiency, reusability and flexibility that jQuery can not provide. Large scale projects ignore jQuery at-together and use JavaScript libraries like React JS that uses latest features of JavaScript to meet the scalability needs.

JavaScript is being developed. Web browsers integrate new JavaScript features in them. jQuery came out in 2006. It was designed to handle Browser Incompatibilities and to simplify HTML DOM Manipulations, Event Handling, Animations, and Ajax. For more than 10 years, jQuery has been the most popular JavaScript library which made things easier for JavaScript developers. After JavaScript Version ES6 in 2015, most of what jQuery offers can be done with a few lines of standard JavaScript code. As for jQuery, it may not need update in future. So JavaScript is a winner here.

JavaScript was not easy before it's version ES6 that came out in 2015. jQuery made several things easy for web developers like: HTML event handling and manipulation, element selection, Ajax, cross-browser compatibility, CSS manipulation and such. jQuery has built-in functions that are easy to use. It has a high-level UI widget library and plugin and play plugins ready to use. JavaScript has become easy with the passage of time.

JavaScript code can contain many lines of code to do same thing that will require less code in case of jQuery. In case of jQuery, we import the library and use the only specific functions or methods of the library in our code to do specific tasks.

In JavaScript, we had to write extra code, use polyfills or move around to have cross-browser compatibility before JavaScript version ES6. JQuery was cross-browser compatibile and still is for what it offers. But JavaScript can now do everything that jQuery could do.

JQuery is developer friendly for what it offers. Only a few lines of code can achieve a functionality that in JavaScript, may need more lines of code. But whatever jQuery offers, can be now done easily in JavaScript also.

Plain JavaScript is faster than jQuery for accessing DOM. In JQuery, we can add animation effects easily with fewer lines of code. In JavaScript it takes more effort and code to animate elements.

And there are many other differences I have talked about in video in detail.

Replace jQuery with Vanilla JavaScript Code Easily | jQuery vs JavaScript
   • Replace jQuery with Vanilla JavaScrip...  

Comparison Playlist:
   • Comparison  

Thank You!
👍 LIKE VIDEO
👊 SUBSCRIBE
🔔 PRESS BELL ICON
✍️ COMMENT

Channel:    / webstylepress  
Website: https://www.webstylepress.com
FaceBook:   / webstylepress  
Twitter:   / webstylepress  
GitHub: https://github.com/webstylepress
#jQuery #JavaScript #JS #comparison #vs #WebStylePress #webdevelopment