📜  javascript 获取类的所有方法 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:38.835000             🧑  作者: Mango

代码示例3
class Foo {
  public doSomething(){
    return 5;
  }
}

let foo = new Foo();
let propertyNames = Object.getOwnPropertyNames(Object.getPrototypeOf(foo));