What is vanilla JavaScript?

Vanilla JavaScript is basically JavaScript without using libraries or frameworks like React, Angular, or Vue.js. Instead of using those frameworks, you're relying only on the language itself and the basic (and not so basic) objects and functions available in the browser.

Those objects and functions that the browser provides is known as the Document Object Model (DOM).

The concept of Vanilla JavaScript is important because you can technically create applications without using frameworks. The thing is, if the application you're trying to build is too complex, it will become too difficult to maintain.

That's why frameworks are fantastic tools when you have to create a big application because they have simple interfaces to tasks that would be too complex if you just use Vanilla JS. Thanks to frameworks, you can create big apps in a maintainable way.

But the flip side is, frameworks add bloat to your project. Frameworks are big pieces of code and they can make your app load slower. So, what do you do?

In big applications, the advantages are bigger than the disadvantages. In those cases, the best thing to do is to use frameworks anyway.

However, if your application is small, just use Vanilla JavaScript, maintaining the code isn't really hard in those cases.

Become a Better JavaScript Developer

Easy, actionable steps to level up your JavaScript skills, right to your inbox. Enter your name and Email address below to subscribe: