Share via


this Statement (JScript 5.6) 

Refers to the current object.


this.property

Remarks

The required property argument is one of the current object's properties

The this keyword is typically used in object constructors to refer to the current object.

Example

In the following example, this refers to the newly created Car object, and assigns values to three properties:

function Car(color, make, model){

   this.color = color;

   this.make = make;

   this.model = model;

}

For client versions of JScript, this refers to the window object if used outside of the context of any other object.

Requirements

Version 1

See Also

Reference

new Operator (JScript 5.6)