Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
kabir kCourses Plus Student 18,036 Points
Also, under what circumstances should one use one over the other?
Hi Kabir! Here is a quick comparison:
The downside of vanilla JS is that it is easier to make mistakes or miss something, is less beginner friendly (than jQuery), and can require you to develop more code to accomplish goals the would take much less time with jQuery.
The primary benefit of jQuery is the reduced development time it offers web devs and its easy to use API and numerous plugins. Also, when you use jQuery you are still writing some vanilla JS, so it is not truly one or the other.
The downside is that by adding it to your project you might bloat the resources you need to load, call unnecessarily verbose methods, and avoid learning how the language actually works.
How to choose
jQuery is a fine choice in the following situations:
- For small projects where perfomance is not a big issue
- Simple projects with a tight deadline
- Large projects that use an MVC library or framework that has jQuery as a dependency
Now, times you might not need jQuery include:
- Acquiring an intermediate - advanced understanding of JS
- Working on complex web applications
- Building you own library or framework
- Server side applications with Node.js
Here is some more on the topic.