This tutorial will go over important built-in object methods, with each section below dealing with a specific method and providing an example of use.
You access an object method with the following syntax:
You will typically describe fullName() as a method of the person object, and fullName as a property.
The fullName property will execute (as a function) when it is invoked with ().
This example accesses the fullName() method of a person object:
This example uses the
toUpperCase() method of the String object, to convert a text
The value of x, after execution of the code above will be:
Adding a new method to an object is easy: