ES2015+ backward compatibility

Do I need to update my current JavaScript code to ES2015? The answer is only if you would like to! ES2015+ are supersets of the JavaScript language. Everything that was standardized as ES5 will continue working as it does today. However, you can start using ES2015+ to leverage the new syntax and make your code simpler and easier to read.

In the following chapters of this book, we will use ES2015+ as much as we can. Suppose we want to create a data structures and algorithms library from this book, and by default, we want to support developers that want to use our library in the browser (ES5) and in the Node.js environment. For now, the option we have is transpiling our code to Universal Module Definition (UMD). For more information about UMD, please go to https://github.com/umdjs/umd. We will learn more about how to transpile ES2015 code with Babel to UMD in Chapter 4, Stacks.

Along with the ES2015+ syntax, for the examples that use modules, the source code bundle also provides a transpiled version of the source code so that you can run the code in any browser.