Last updated 3 years ago
Was this helpful?
Xem them:
function Cat(name, age=1) { this.name = name; this.age = age; } Cat.prototype.speac = function() { console.log("aaaaaaa"); } const cat = new Cat("Boris",2);
Result