JavaScript has another name — ECMAScript (or ES for short).
- 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 with new JavaScript features.
- ES6 is also called ES2015 because it was finalized in 2015.
- ES7 is called ES2016
- ES8 is called ES2017, and so on…
The whole “ES” branding kind of stopped after 2018 so we just call everything JavaScript again.
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.It used to be recommended because it protects you from deprecated practices.
To use strict mode, you add use strict to the function you wish to enable it for.
function () { 'use strict' // Strict mode enabled}You don’t need strict mode anymore today, because of two reasons:
- Everything you learn here is Strict Mode compliant.
- Most JavaScript is written in modules today, and modules use Strict Mode automatically. (We’ll talk about modules in a bit).
This is an optional and unnecessary read, but here’s a list of things that strict mode prevents if you’re curious.
Welcome! Unfortunately, you don’t have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson