So i want to create a class and add a getter to return something when getting the entire instance instead of a getter on one of the children.
example:
class Person {
constructor(name){
this.name = name
}
get () {
return "My name is " + this.name;
}
}
const Alexander = new Person("Alexander")
console.log(Alexander) // My name is Alexander
So the above is what i want to achieve, but i am unable to and struggling to find something online like this, unsure if it is possible or my wording is just incorrect.