Tag: ECMA 6

Javascript

ES6 Destructuring

Using this feature values can be assigned to variables by matching patterns in an array or object. This is fail-soft, so if match fails, a variable will be initialized as undefined In the last two ex

Javascript

ES6 Template Literals

In ES5 to create a dynamic string, static string parts have to be concatenated with Javascript variables. ES6 introduces template literals using which manual concatenation can be avoided. See the exam

Javascript

ES6 Object Literals

ES6 enhances the syntax used to initiate an Object. See the example below. Another example that shows how local variables and functions can be easily used in the object literal x)() ]: x * 10,

Javascript

ES6 Class

Classes are one of the major features of ES6. In fact it wraps prototype based Object Oriented design and provides the developer a better and easier method to write code. It also helps developers who

Javascript

ES6 Arrow Functions

In ES6, a function can be written in a new way using =>. x/10; myFunc(50); // gives 5 --> This is useful in writing nameless handler functions. It has the same context as the code from which it i