Although ES6 was released a while ago, I’m still discovering some small features which I wasn’t aware of, some more important then others but they all can improve your quality code.
The repeat() function
They are languages like Ruby and Python were you can do stuff like
"hello" * 2 which will then give you
'hellohello', there wasn't anything like that before in Javacript, from ES6, they introduce repeat().
String injection fuctions
There is three different and usefull methods which can be apply in common situatuions: includes(), startsWith() and endsWith()
It takes two arguments, the string we are targeting and the position number.
Pretty much the same as startWidth but the position number reads from right to left.
I won't call this one an unknown feature, but still worth mentioning.
Working with integers could be quite important, depending on what you are doing, you need to take care of different situations.
Is common to use Math.floor() when working with decimals, ES6 added a helper called Number.isInteger() that could be helpful as well.
The isNaN() function was broken for years, now is being fix when you use Number.isNaN().
We usually use
==== for equality comparison in most cases ans it won't change soon, however, in ES6 the helper Object.is() is even more strict.
Delegating responsibilities in a smart way.