I have javascript this class :
class Student {
constructor(name, birthDate) {
this.name = name;
this.birthDate = birthDate;
}
get age() {
return 2018 - this.birthDate;
}
display() {
console.log(`name ${this.name}, birth date: ${this.birthDate}`);
}
}
console.log(Object.getOwnPropertyNames.call(Student));
I want to get properties list names. I tried to use something like this:
Object.getOwnPropertyNames.call(Student)
But it doesn't work. what should I get in this example is name and birthDate only. without other methods or getters.