visual studio - How can I list the methods of a JavaScript object in VS command window? - Stack Overflow

When debugging JavaScript in Visual Studio 2008 and I use the ? mand in the mand window to list a JavaS

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 badges
Add a ment  | 

1 Answer 1

Reset to default 6

I 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信