Terms: Static Members

Static Members are used with object oriented programming. A static member is a variable shared between all instances of an object. For example, if you had an object myObject with the static member objectCount, then myObject.objectCount++ would increase this value by 1 across all instances of myObject.

As javascript is not a typical object oriented language, the way object are created is slightly different. It seems typically they are assigned to a function - ie:

myObject = function(){ createObject(); }

and then

myObject.objectCount = 0;

Yes. This does mean you are assigning values to functions. I know! I'm still trying to wrap my head around it as well. I'm not even sure I'm using the right terminology to define this. So HA!

Let's just worry about understanding the definition of static member for now, shall we?

1 comments:

sarahbee said...

Opposite of static member = instance member! Wheeee learning!

Post a Comment