• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

query javascript class for property

I have a javascript class (one from Sench Touch component class). I would like to be able to query that class to figure out what events it supports.

Is there a way to do this in javascript what is equivalent to reflection in Java?
  • 2
1 Solution
Gurvinder Pal SinghCommented:
if you need to check whether it has a particular method or property or not, then you simply needs to check

if ( classname.methodOrPropertyName )
   //yes supports

check this too
bhomassAuthor Commented:
this works.

                                                var properties = [];
                                            for (var propertyName in form){
bhomassAuthor Commented:
good pointer from expert. I had to do some more research to get what I needed.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now