Help with 'this.' statement! PLEASE!


#1

Can someone please explain how the 'this.' statement works in JavaScript, and how to use it(in REALLY simple terms) I am WAY confused!


#2

You've got a bunch of objects right.
You want to do things with them. Modify their attributes and what not.

this is a reference to the object that you are currently dealing with.

If the object is a ball, and you have a method that paints a ball blue, then that method would do:

this.color = 'blue'


#3

Thnx! So much easier now!