I'm trying to understand better OOP. Anyone can explain what is the difference between this two object below? How javascript can display the both are varible of type object, if both seems completely different.
class Dog {
constructor(name) {
this.name = name;
}
bark() {
console.log(`Woof! My name is ${this.name}`);
}
}
const fido = new Dog('Fido');
fido.bark();
console.log(typeof fido)
let dog = { name : "Baby"};
console.log(typeof dog)