Skip to content

Tag Archives: javasript

Modern JavaScript Development: Reflection in JavaScrpt

23-May-08

Sometimes you want to find out what members an object exposes. There's a pretty simple way to do this. A simple for-in statement.
PLAIN TEXT
CODE:

for(var member in obj){ alert(member); };

No really, that's it. No "imports" or "using" statments. No complicated classes to memorize, no unwrapping or casting. Just for-in over an object. One caveat, this [...]