1. Role of JS Libraries and Frameworks
⚛What Is the Role of JS Libraries and Frameworks, and Why Are They Used in the Industry?
-
They are pre built code that stream lines the development project. Libraries and frameworks improve the productivity and and standardize the coding practices.
-
Libraries are generally more focused on providing solutions to specific tasks, such as manipulating the DOM, handling events, or managing AJAX requests.
⭐JavaScript Libraries
-
A library is a collection of prewritten code you can use to perform common tasks. Example:
jQuery– popular in the 2010s for making DOM manipulation, animations, and event handling easier. -
It saved time and effort compared to writing plain (vanilla) JavaScript.
-
Libraries are flexible — you decide how to use them in your project.
🖼 JavaScript Frameworks
-
Frameworks provide a fixed structure and rules for building apps.
-
They tell you how to organize your code.
-
Example:
Angular– uses a component-based structure and built-in tools for routing, state management, etc. -
Other examples:
Next.js,Remix.
⚛ React (In Between)
-
React is technically a UI library, but it’s often used like a framework.
-
It focuses on the view layer and gives more flexibility in how you structure your app.
What is the use case of using Libraries and Frame works?
✅ Speed up development
✅ Solve common problems (like handling dates & time zones)
✅ Tested and maintained by large communities
✅ Follow best practices → more reliable, scalable apps
⚙️Summary
- Libraries = tools** you pick and use freely.
- Frameworks = structure** you build your app inside.
- Both make coding faster, easier, and more organized.
👨💻Quiz
-
Why was jQuery a popular library of choice in the early 2010's?
- Simplify things like DOM (Document Object Model) manipulation, event handling, animations and effects.
-
Which of the following is an example of a JavaScript library?
- React
-
Why are JavaScript libraries and frameworks widely used in the industry?
They Speed up the development and promote best practices.