Category

ES6

ES6

ES6 - Native Modules

Defining modules were not available in Javascript earlier, compared to other languages. requirejs and other libraries were used to overcome this. However, ES6 introduced a module loader API which enables native module loading in javascript. Let's look at how to implement native modules. Look at...

ES6

ES6 - Spread Operator

var state = {'veg': 'potato'} //All Same state = $.extend({}, state, {'fruit': 'apple'}) // jQuery state = Object.assign({}, state, {'fruit': 'apple'}) // JS state = { ...state, 'fruit': 'apple'} //ES6 Spread operator Notice the above code it does the same thing. Spread operator is an easy to use syntax for object/...