Output đoạn code javascript sau là gì? Hãy giải thích tại sao?
Output đoạn code javascript sau là gì? Hãy giải thích tại sao?
class Dog {
constructor(name) {
this.name = name;
}
}
Dog.prototype.bark = function () {
console.log(`Woof I am ${this.name}`);
};
const pet = new Dog("Mara");
pet.bark();
delete Dog.prototype.bark;
pet.bark();
"Woof I am Mara", TypeError"Woof I am Mara","Woof I am Mara""Woof I am Mara", undefinedTypeError, TypeErrorChúng ta có thể xóa các thuộc tính khỏe object bằng từ khóa delete,...
middle