JavaScript ES6 is the latest version available( as of 2021/June/1) since 2015. It’s also known as ES6 and ECMAScript 2015. So many awesome features were introduced with ES6, to make programmers work easy.
Here a list of some features that came with ES6. If you are looking for the full specification of ECMAScript 6 please visit from here.
That sure is a long list. So, today let’s talk about some of the top features from this list.
You can also read: Top JavaScript Frameworks For Developers .
Before ES6 there was only one way to declare variables in JS and that was with the var
keyword. ES6 introduced let
and const
.
const and let works almost the same way. But with const
you can declare constants(Read-only), so the variables declared as constants will be read-only. But this does not affect object properties or array elements.
When you declare a variable outside any function it’s global scoped. It can be accessed from anywhere in the program. When a variable is declared inside a function it’s said to be function scoped (ex: let and const).
#javascript #es6 #js #modern-javascript