128
rated 0 times
[
135]
[
7]
/ answers: 1 / hits: 21958
/ 9 Years ago, wed, june 17, 2015, 12:00:00
Given this class; how would i iterate over the methods that it includes?
class Animal {
constructor(type){
this.animalType = type;
}
getAnimalType(){
console.log('this.animalType: ', this.animalType );
}
}
let cat = window.cat = new Animal('cat')
What I have tried is the following with no success:
for (var each in Object.getPrototypeOf(cat) ){
console.log(each);
}
More From » ecmascript-6