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?
Showing posts with label static member. Show all posts
Showing posts with label static member. Show all posts
Terms: Static Members
Posted by
sarahbee
on Monday, July 27, 2009
Labels:
definition,
javascript,
object-oriented,
static member,
terms
/
Comments: (1)