'A class constructor encapsulates all properties and methods. However, methods can also be defined outside the constructor in a class.' What is the difference between defining a method inside the constructor or outside the constructor, if both will be on the prototype anyway, and both are within the same class? For example, displayName and getAge
Ex:
class employee{
constructor(name,age){
this.name= name
this.age= age
this.displayName = function() {
console.log("Name is:", this.name)
}
}
getAge(){
return this.age
}
}