JavaScript is an independent language and can exist on its own. jQuery is a JavaScript library. ... jQuery uses fewer lines of code than JavaScript for the same functionality as the code is already written in its library, we just have to import the library and use the relevant function/method of the library in our code.