Sometimes I miss Python's dir() function a lot. It's so comfortable to
use it while programming on an interpreter shell! I wonder why
JavaScript doesn't come with something similar as a built-in function.
Experimenting a little, I came up with this simple, yet very handy code:
function (o) { r = new java.util.ArrayList(); for (i in o) { r.add(i); } return r; }
This has the same effect as Python's dir(), and can list the properties, methods and functions of any Java object:
Interesting to note that JavaScript strings don't get any properties,
methods or functions listed. I'll have to take a better look at this
and understand what's happening. For now, I've got a kick-ass
interpreted Java object browser...