šThe getName() is called a method of the Person class.
šLike a constructor function, you can call the methods of a class using the above syntax:
@javascript_tut
'javascripttutorial. net'
šLike a constructor function, you can call the methods of a class using the above syntax:
@javascript_tut
'javascripttutorial. net'
To verify the fact that classes are special functions, you can use the typeof operator of to check the type of the Person class.
@javascript_tut
'javascripttutorial. net'
@javascript_tut
'javascripttutorial. net'
The john object is also an instance of the Person and Object types
@javascript_tut
'javascripttutorial. net'
@javascript_tut
'javascripttutorial. net'
Forwarded from Ela Car