Yes but what you need to do is iterate over the Object's prototype. In CoffeeScript it would look like this:
for key, value of MyClass.prototype
console.log key, ':', value
EDIT:
In JavaScript it would be this:
var i;
for (i in MyClass.prototype) {
// This condition makes sure you only test real members of the object.
if (Object.prototype.hasOwnProperty.call(MyClass.prototype, i)) {
console.log(i, ':', MyClass.prototype[i]);
}
}
EDIT 2:
One caveat: this will not work with native JavaScript constructors so Math
is a bad example. If you are using custom class constructors, it will work fine.