Hallo,
unzwar bin ich gerade, in dem JavaScript Tutorial, welches ich durcharbeite, auf etwas gestossen, das ich nicht verstehe.
Ich habe das schon öfters gesehen.
z.B. this.checked; oder sowas in der Art
Aber was dieses this ist, verstehe ich irgendwie nicht richtig.
Hier der ausschnitt aus dem Tutorial:
| Code: |
2. Create a template of an object
The template defines the structure of an object:
function person(firstname,lastname,age,eyecolor)
{
this.firstname=firstname;
this.lastname=lastname;
this.age=age;
this.eyecolor=eyecolor;
}
Notice that the template is just a function. Inside the function you need to assign things to this.propertyName. The reason for all the "this" stuff is that you're going to have more than one person at a time (which person you're dealing with must be
clear). That's what "this" is: the instance of the object at hand.
|
Hoffendlich könnt ihr es mir erklären.
mfG
theSonGoku