Object methods "this": Method shorthand

// these objects do the same

let user = {
  sayHi: function() {
    alert("Hello");
  }
};

// method shorthand looks better, right?
let user = {
*!*
  sayHi() { // same as "sayHi: function()"
*/!*
    alert("Hello");
  }
};

There exists a shorter syntax for methods in an object literal.

Related concepts

Object methods "this": Method shorthand — Structure map

Clickable & Draggable!

Object methods "this": Method shorthand — Related pages: