![]() |
VOOZH | about |
Object Methods in JavaScript can be accessed by using functions. Functions in JavaScript are stored as property values. The objects can also be called without using brackets ().
Syntax:
objectName.methodName()
Properties: A function may be divided into different property values, which are then combined and returned together.
For Ex: The student function contains the properties:
Return Value: It returns methods/functions stored as object properties.
Example 1: This example uses function definition as the property value.
Martin 12th A
Example 2: This example uses storing property values and accessing without bracket ().
[Function: studentDetails]
Example 3: Using function definition as property value and accessing with additional details.
STUDENT Martin 12th A