Skip to main content

Bright Shiny Object(s) using Enhanced Object Literals

  • Chapter
  • First Online:
  • 1658 Accesses

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://eslint.org/docs/rules/comma-dangle

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Raju Gandhi

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics