ES6 onwards provides a new syntax for defining the methods on an object. The following example demonstrates the new syntax:
let object = { myFunction(){ console.log("Hello World!!!"); //Output "Hello World!!!" }}object.myFunction();
This concise function allows the use of super in them, whereas traditional object methods don't allow the use of super. We will learn more about this later in the book.