What is Vanilla JavaScript?

“Vanilla JavaScript” is a term that developers use to describe regular JavaScript.

It means using the inbuilt methods and objects without any additional libraries or frameworks.

As a result, “Vanilla JavaScript” code should work straight out of the box. There shouldn’t be any need to download or include an external library for it to work.

The hint is in the name.

The definition of the word “vanilla” describes it as something that has “no special or extra features”. In other words, ordinary or standard.

Why did the term “Vanilla JavaScript” become popular?

The term “Vanilla JavaScript” became popular because of the prevalence of external JavaScript libraries such as jQuery and MooTools.

As the usage of external libraries and plugins increased, the line between regular JavaScript and jQuery became “blurred”.

Beginner developers often didn’t even know the difference between the two.

It wasn’t long before the JavaScript “ecosystem” became flooded with popular plugins and tools that relied on external libraries.

jQuery in particular, is a perfect example. jQuery is an excellent library that can help you to simplify certain operations.

It can also save you a lot of time and effort. Furthermore, the library helped to paper over many of the cross browser issues that existed back when Internet Explorer was still widely used.

Basically, I like the library, and in no way am I “hating” on it.

However, jQuery’s popularity began to “take over” and soon enough, it started to become difficult to find a JavaScript solution that didn’t involve using it.

Many tutorials presumed that you were already using the library. Users on question and answer websites began recommending it for the simplest of operations. Plugins for datepickers and other common tools began to depend on it.

All in all, it became frustrating.

Especially if you just wanted to do one small thing without having to include a bulky library.

What is VanillaJS?

VanillaJS is a spoof framework. It’s basically a joke / satire.

If you configure the various options and download the vanilla.js file, you will find that it is completely empty. This is regardless of which features you select.

Vanillajs

A screenshot of the vanilla.js file that I downloaded. As you can see, it is 0 bytes in size.

The person behind VanillaJS obviously created it in order to poke fun at those who believe that every project must use a library or a framework.

The site itself even points out that popular websites such as Facebook, Twitter and Google use VanillaJS. And technically, that statement is correct.

The best kind of correct.

Conclusion.

And there you go. Vanilla JavaScript is just another term that is used to describe regular JavaScript.

Although libraries and frameworks are still hugely popular, they are no longer a necessity. Many of the issues that came with legacy browsers have long since been solved. Modern browsers are now much better at following open standards.

As a result, you can now decide if a library is really necessary instead of just blindly using one.