Object methods "this": Method examples

Let user = {
  name: "John",
  age: 30
};

*!*
user.sayHi = function() {
  alert("Hello!");
};
*/!*

user.sayHi(); // Hello!

A function that is the property of an object is called its method.

Object methods "this": Method examples — Structure map

Clickable & Draggable!

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