O'Reilly logo

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond by JD Isaacks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 12. New object literal syntax

After reading lesson 12, you will

  • Know how to use shorthand property names
  • Know how to use shorthand method names
  • Know how to use computed property names

I don’t think there’s anything as ubiquitous in JavaScript as the object literal. They’re everywhere. With a tool that’s used so frequently, any conveniences can have a huge net positive on productivity. Three syntactic additions to object literals introduced in ES2015 make them much more of a pleasure to read and write. You don’t gain new functionality, but having code that’s easy to read and write, especially when it comes to maintenance, is just as important a feature.

Consider this

Look at the following object literal. What parts seem ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required