5 Vanilla JavaScript
This chapter covers
- How JavaScript has evolved into ECMAScript versions and what this means for Vanilla projects.
- The essentials of modern JavaScript syntax and patterns you will use on a daily base.
- Coding using ES Modules in Vanilla Web projects.
- Handling errors for robust apps without external libraries.
One of the most prominent parts of a Vanilla Web project is JavaScript, specifically what we usually refer to as Vanilla JavaScript: the use of the core language and browser APIs to develop apps without large libraries or frameworks.
In the previous chapters we covered the Web UI basics, including the semantic usage of HTML and modern CSS features. In this chapter we’ll start covering how to use JavaScript to enhance HTML and CSS through dynamic features without using libraries or frameworks. JavaScript is the only programming language compatible with all browsers and web rendering engines.
Before moving on with the JavaScript code, it is essential to understand how JavaScript is versioned under its original name, ECMAScript. By versioning, we are thinking about how we name new abilities in the language and in the execution engine. Do we have a JavaScript 3.0? Or maybe a JS 9.1.1?