Advertisement

Bright Shiny Object(s) using Enhanced Object Literals

  • Raju Gandhi
Chapter

Abstract

The literal object syntax ({}) in JavaScript is a powerful mechanism that allows us to describe objects literally in code. This {} syntax is rather elegant, and succinct; however, there remain a few warts—defining methods can be a tad verbose, and tacking on computed properties is at best clumsy. ES6 supercharges this syntax, giving us a way to initialize properties and methods even more concisely, while simultaneously elevating the ability to define computed properties to a first-class citizen.

Copyright information

© Raju Gandhi 2019

Authors and Affiliations

  • Raju Gandhi
    • 1
  1. 1.ColumbusUSA

Personalised recommendations