We can declare a function inside the object and directly assign it to a property.
In the example given below,
we are declaring the function inside the
and assign it to the
However, we can choose not to write the word “function”.
In the example given above,
we are creating the
using a shorter syntax.