In this article we will go through what’s new and what’s changed.
Truth to be told, an answer to the question: “What’s new in ES6” is the same as to the question “What’s updog?”. Yes, it’s “Not much” 😂
Anyways, there is still progress, so let’s check that out:
Table of contents:
- Exponential operator
This is very useful functions, when you want to check, if there is an item inside an array.
Up until now you could have used the syntax shown at the example below.
const items = [1, 2, 3, 4]; const theArrayDoesIncludeNumberFour = items.indexOf(4) !== -1;
Well, that is not going to be necessary and the new more prettier syntax will be as follows:
const items = [1, 2, 3, 4]; const theArrayDoesIncludeNumberFour = items.includes(4);
Also, for quite a time it’s been possible to raise a number to the power of another, for example
2⁴ = 16 or
Math.pow(2, 4) === 16.
From now on, it will be possible to use a new exponential operator
** in the following way:
2**4 === 16
🙂 no guys, I am not joking, that’s it.
And also if you liked this article, don’t forget to share it with people you like (or maybe also people you don’t like, maybe you’ll became friends! 😆 ).
I will be doing more articles like this in the future and if you want to get notified about them and everything else I release, subscribe to my newsletter right here.
Anyways, thanks for reading and I’ll see you in the next article! 🤓
Yours in coding,