Category: ES6

Made by Marvin Drude

Useful features in JavaScript ES6

Constants The support of constant variables was added in ES6. This allows to define variables which cannot be altered after first initialization. Although be careful, if for example you define an object as constant, you can still alter the object itself, for example adding new properties. String Interpolation Everyone knows the string concatenation from before: …

JavaScript Classes ES5 vs ES6

I just wanted to show the difference between classes in JavaScript ES5 and ES6. Let’s start with ES5 and the decleration of the class itself. As you can see, we declare a class and its constructor just like another function. Having done this we can continue with beginning to write methods of the class Animal. …