Is there any way I can view the variables used in a javascript function without trawling through the code?
Using javascript on a server so cant really install an app to debug, is there a javascript function i can use in some way?
Is there any way I can view the variables used in a javascript function without trawling through the code?
Using javascript on a server so cant really install an app to debug, is there a javascript function i can use in some way?
Hi,
Well to list them you could try something like: for (var avar in this) console.log(avar)
Anyway, doesnt your server side JavaScript engine allow you to place breakpoint and see the vars in real time?
HTH
Not unless the JavaScript implementation you're using has some extension that provides such a feature (browsers don't). JavaScript resolves identifiers inside a function using the scope chain; there's no single object that contains all the variables in scope, and the objects in the scope chain are inaccessible from code.