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


Using object literal we can directly set one object as the prototype of another. See the example below

Share