📜  javascript 列表类属性 - Javascript 代码示例

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

代码示例1
function getClassProperties(instanceOfClass) {
  const proto = Object.getPrototypeOf(instanceOfClass);
  const names = Object.getOwnPropertyNames(proto);
  return names.filter(name => name != 'constructor');
}