When debugging JavaScript in Visual Studio 2008 and I use the ? mand in the mand window to list a JavaScript object's members I always get that ellipses {...}. Example:
>? Page_Validators
{...}
[0]: {object}
[1]: {object}
[2]: {object}
[3]: {object}
[4]: {object}
[5]: {object}
length: 6
I'm assuming these are the object's member functions. Is there a way to list the members in that {...} ? A one-liner mand would be ideal.
Thanks.
When debugging JavaScript in Visual Studio 2008 and I use the ? mand in the mand window to list a JavaScript object's members I always get that ellipses {...}. Example:
>? Page_Validators
{...}
[0]: {object}
[1]: {object}
[2]: {object}
[3]: {object}
[4]: {object}
[5]: {object}
length: 6
I'm assuming these are the object's member functions. Is there a way to list the members in that {...} ? A one-liner mand would be ideal.
Thanks.
Share Improve this question edited Oct 24, 2008 at 22:08 Jason Bunting 59k16 gold badges104 silver badges94 bronze badges asked Oct 24, 2008 at 21:16 John GrantJohn Grant 5739 silver badges17 bronze badges1 Answer
Reset to default 6I just tried this and it works, with one caveat:
? (function () { var m = []; for (var p in Page_Validators) { if(typeof Page_Validators[p] == "function") { m.push(p); } } return m; })()
That will show you all of the methods that are part of the object, but none of the built-in inherited methods (like toString()
or valueOf()
).
Hope that helps.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744388545a4571789.html
评论列表(0条)