Let's assume I have this class:
const Human = function () {
this.name = 'James';
}
And I am going to create a new Person
class that inherits Human
:
const Person = function () {
this.gender = 'Male';
}
Person.prototype = new Human();
Then I am going to create a new Person instance:
let _p = new Person();
How can iterate through the list of the members (name, gender)?