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.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Raju Gandhi
About this chapter
Cite this chapter
Gandhi, R. (2019). Bright Shiny Object(s) using Enhanced Object Literals. In: JavaScript Next. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5394-6_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-5394-6_7
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-5393-9
Online ISBN: 978-1-4842-5394-6
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books