We can store a function as the property of an object. Such functions are called methods of the object.
In the example given below,
we are using a function expression to create the function
assign it to the property
sayHello is the method of the
We can also declare a function before assigning it to a property.
In the example given above,
we first declare the
Then we assign it to the