Given:
var car = class Car{
drive() {}
park(){}
}
Given car, how can I find what methods this class has, ie "drive" and "park" ? I would have thought they were on
car.prototype
It's true that
car.prototype.drive
returns the method and
car.prototype.hasOwnProperty("drive") => true
but
for(let prop_name in car.prototype){
console.log(prop_name)
}
prints nothing.