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.
In this chapter we will see how these enhancements make building objects in JavaScript ...