Two Laptop Bag*
The moose likes HTML, CSS and JavaScript and the fly likes Object object - size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Object object - size " Watch "Object object - size " New topic
Author

Object object - size

Arya Devan
Greenhorn

Joined: Feb 07, 2006
Posts: 28
hi all .. i have a small doubt... if i were to declare something like ..
var x = new Object() and i put something in the variable x . how am i supposed to find the size of this object x ??


Arya.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What do you mean by size? Do you mean a list of all of its properties. An object is not like an array where you can just reference a length.

Eric
Arya Devan
Greenhorn

Joined: Feb 07, 2006
Posts: 28
yes .... i want the list of all its properties. how should i find it ?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You need to look into the for(x in y) loop

Eric
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Object object - size