prototype  Object  class propertyS2C Home  « Globals « Object « prototype

Description

Enables property assignment to objects of type Object.

  • All objects are descendants of Object.
  • All objects inherit their properties and methods from Object.prototype.
  • So when overriding an Object method such as valueOf(), you would override as follows:
    yourObject.prototype.valueOf = function functionName {your override code}
  • Like all class properties prototype should be used on the class rather than an instance of the class.

Syntax

Signature Description
Object.prototypeEnables property assignment to objects of type Object.

Parameters

None.

Examples

The code below displays Object prototype.


alert('Object prototype is ' + Object.prototype);

Press the button below to action the above code:


Related Tutorials

JavaScript Basic Tutorials - Lesson 7 - Objects

go to home page Homepage go to top of page Top