Get the public properties of a class without creating an instance of it?
问题 Let's imagine that we have a JavaScript class: var Person = (function () { function Person(name, surname) { this.name = name; this.surname = surname; } Person.prototype.saySomething = function (something) { return this.name + " " + this.surname + " says: " + something; }; return Person; })(); I want to iterate its methods and properties. I have no problem with the methods. var proto = Person.prototype, methods = Object.keys(proto); // iterate class methods ["saySomething"] for (var i = 0; i <