In JS, I can do something like this:
for(i in MyClass.prototype) {
console.log(i);
}
And it will show me the method names. That's fine.
Now, if I do this with coffeescript:
for i in MyClass.prototype
console.log i
It will be compiled to:
var i, _i, _len, _ref;
_ref = MyClass.prototype;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
console.log(i);
}
But prototype doesn't have a length
property, so, it breaks.
How can I make it with coffeescript?