Can't loop over object.prototype

Viewed 34

class SomeClass {
  myFunction() {
    console.log('Hello, World');
  }
}

for (let obj in SomeClass.prototype) {
  console.log(obj);
}

Hi everyone, I am trying to loop over class's prototype but it's not working, it doesn't give an error loop just won't execute, I tried running this code in dev tools same situation, what's wrong here, how do I loop over prototype object?

0 Answers
Related