What exactly is vanilla JavaScript?

The term "vanilla JavaScript" has caused some confusion amongst beginners. This post explains the origins of the term "vanilla" and how it relates to computer software and the JavaScript language.

  1. #JavaScript
  2. #Glossary

The term vanilla

The term vanilla originates from the traditional standard flavor of ice cream, vanilla flavor. It's an adjective that describes the simplest version of something, without any optional extras.

Various computing-related things like software, hardware or algorithms are called vanilla when they are not customized, but remain in their original, basic form. In this usage context, the word vanilla is used synoymously to the words ordinary or standard:

Having no special or extra features; ordinary or standard.

Oxford English Dictionary

What's included in vanilla JavaScript?

There is no official definition of vanilla JavaScript or vanilla JS. These terms refer to the language itself, without any external additions like libraries, frameworks or other packages. Because JavaScript is standardized as ECMAScript, vanilla JavaScript includes the standard language features described in the ECMA-262 specification.

Venn diagram of Vanilla JavaScript

Additional APIs are assumed to be present when programming JavaScript, depending on the context.

  1. JavaScript in a browser

    When JavaScript is running in the browser, additional Web APIs like the DOM and CSSOM or the fetch and canvas APIs are available.

  2. JavaScript in Node.js

    When JavaScript is running in Node.js, additional Node APIs like HTTP or the file system API are available.

Because both Web and Node APIs are not external additions, JavaScript code using them is typically also considered vanilla JavaScript. The combination of Node.js APIs and the ECMAScript standard is sometimes referred to as vanilla Node.

It's not a framework

The term vanilla JS is often used as a joke to remind other developers that a lot of things can be easily done without the need for additional JavaScript libraries or packages.

There's even a website that builds upon this joke by attempting to market vanilla JS as a "very fast framework". Even though reminding developers that a lof of things can be done without using additional libraries, this is very confusing to beginners.

Don't get confused! Vanilla JavaScript is not a framework.