Stuff I am building:


Ted Patrick - Events & Community @ Adobe Systems


Note: This is the personal blog of Ted Patrick. The opinions and statements voiced here are my own.



Object Class Smells Funky

DIGG IT!     0 Comments Published Wednesday, June 04, 2003 at 10:54 AM .

I always thought the Object Class was a bit odd. This explains the smell....

//use new
a = new Object('myString')
b = new Object(1)
c = new Object(true)
d = new Object(MovieClip)
e = new Object(_level0)
f = new Object()

//no new
g = Object('myString')
h = Object(1)
i = Object(true)
j = Object(MovieClip)
k = Object(_level0)
l = Object()

The last call above is very strange. If you call Object without any parameters, it returns an object with absolutely no properties at all (including __proto__). This object is just pure memory.

I will never look at Object the same way.

ted ;)

0 Responses to “Object Class Smells Funky”

Post a Comment

Where to find me:

Ted on Twitter - @AdobeTed
Ted on Adobe Groups
Ted on LinkedIn
Ted on Facebook
Ted at Adobe


Latest

Lists

Links

Jobs

Flex Jobs
city, state, zip

Archives