Varying versions of JavaScript

Hey ,

I'm thrilled to help you learn JavaScript. Unfortunately, you've landed on a page where you cannot access with your current purchase.

Please upgrade (use this link) access this content.

I'm super eager to help you learn more!

Varying versions of JavaScript

JavaScript has another name—ECMAScript.

ES6 is the 6th edition of ECMAScript, ES7 is the 7th edition of ECMAScript, ES8 is the 8th edition of ECMAScript, and so on. Each version of ECMAScript provides us users with new JavaScript features.

ES6 is also called ES2015 because it was finalized in 2015. Consequently, ES7 is called ES2016, ES8 is called ES2017.

Any new features of JavaScript that are proposed but not finalized are classified under ES.Next.

ES-year names can be misleading!

You may think that, since it’s 2017, you should be able to use ES2017 (or ES8). Right?

Unfortunately, you can’t. ES(Year) tell us when the spec was finalized. It doesn’t tell you whether browsers support a feature that was finalized in the spec.

Since features need to be implemented by different browser vendors, you should take note of support for the features you’d like to use via this compatibility table and not rely on ES(Year) names.

At the time of writing, almost all features up to ES2017 have been supported by major browsers.

Learn ES6, ES7, ES8, and beyond

Even though JavaScript has moved beyond ES6, you’ll still hear the noise regarding ES6 because ES6 brings about major features that changed how we wrote JavaScript. Some of these changes are so drastic that beginners often get completely lost.

Don’t worry about different ES versions. In this course, you’ll be introduced to JavaScript features when the time is right.

Strict mode

Strict mode was introduced in ES5 to help you enforce better code practices. It was used often when we were hovering between ES3 and ES5.

To introduce strict mode to your code, you add the 'use strict' within all functions:

function () {
  'use strict'
  // Strict mode enabled
}

Strict mode used to be highly recommended because it protects you from practices that are deemed deprecated.

In today’s world, we won’t need strict mode because of two reasons.

First, everything you’ll learn in this course is strict mode compliant. Since everything is already strict mode compliant, there’s no real need to add it to your code. (You might still want to add it if you have JavaScript developers who copy/paste code from Stack Overflow in your team. This is because some answers from Stack Overflow might be old and deprecated).

Second, even in the case where you need strict mode, transpilers (tools that convert ES.Next code and other cutting edge JavaScript features to ES5) can help you enforce strict mode automatically. A popular transpiler is Babel.

Note: if you’re curious, you can find a list of things strict mode protects from doing. (It’s going to be overkill to read it at this point, but when you’re done with the course, you can come back here, and you’ll realize everything you learned in this course doesn’t violate strict mode).