Defining methods on object literals has always been possible with normal key-value pairs. More recent versions of ECMAScript have added a shorthand that mimics the syntax for defining methods on classes.
In this recipe, we'll see that we can create and override methods on object literals using either technique.