get methods from class javascript code example
Example: get methods of class javascript
class Hi {
constructor() {
console.log("hi");
}
my_method(){}
static my_static_method() {}
}
function getMethods(cl) {
return Object.getOwnPropertyNames(cl.prototype)
}
console.log(getMethods(Hi)) // => [ 'constructor', 'my_method' ]