> One way to reduce memory bloat and initialization time is to declare
> the local properties of an object as prototype properties. Prototype
> properties do NOT take up extra space when an object is instantiated
> UNLESS you change the instances' local value. For instance, 

But avoid this pitfall:

function testobj() { }
testobj.prototype.test = []

t1 = new testobj()
t1.test[0] = "Test1"

t2 = new testobj()
t2.test[0] = "Test2"

alert("Content of t1.test: " + t1.test + ".\n Surprised?")


Stephan


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to