New Object Functionality
Learn how to use new object features in ES2015+ such as property shorthand, simplified method definitions, and special getters and setters. Understand how these simplify code and add powerful ways to access and assign object properties.
We'll cover the following...
We'll cover the following...
Properties
If we’re adding a variable as a property to an object, we’d do it like this.
We can now omit the colon and the variable name repeat, as long as the variable name is the same as the property name we want on the object. In other words, the block above is the same as this one.
It’s just a shorthand to let you ...