How can I get all the properties from extends class?
class Fish {
constructor(name) {
this.name ="this is the name"
}
}
class Trout extends Fish {
constructor(name, length) {
super(name)
this.length = "10cm"
}
}
let newFish =new Trout()
console.log (newFish.name)
console.log (newFish.length)
Is there any way to get in a loop to get name,length,etc what every set it in the extends classes?
console.log(newFish[0]) something like that