Help with 'this.' statement! PLEASE!


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


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'


Thnx! So much easier now!