JAVASCRIPT Telegram 2732
CHALLENGE

function Vehicle(type) {
this.type = type;
}

Vehicle.prototype.describe = function() {
return `This is a ${this.type}`;
};

function Car(brand) {
Vehicle.call(this, 'car');
this.brand = brand;
}

Car.prototype = Object.create(Vehicle.prototype);
Car.prototype.constructor = Car;

Car.prototype.describe = function() {
return Vehicle.prototype.describe.call(this) + ` made by ${this.brand}`;
};

const tesla = new Car('Tesla');
console.log(tesla.describe());
console.log(tesla.constructor.name);
2



tgoop.com/javascript/2732
Create:
Last Update:

CHALLENGE

function Vehicle(type) {
this.type = type;
}

Vehicle.prototype.describe = function() {
return `This is a ${this.type}`;
};

function Car(brand) {
Vehicle.call(this, 'car');
this.brand = brand;
}

Car.prototype = Object.create(Vehicle.prototype);
Car.prototype.constructor = Car;

Car.prototype.describe = function() {
return Vehicle.prototype.describe.call(this) + ` made by ${this.brand}`;
};

const tesla = new Car('Tesla');
console.log(tesla.describe());
console.log(tesla.constructor.name);

BY JavaScript


Share with your friend now:
tgoop.com/javascript/2732

View MORE
Open in Telegram


Telegram News

Date: |

Members can post their voice notes of themselves screaming. Interestingly, the group doesn’t allow to post anything else which might lead to an instant ban. As of now, there are more than 330 members in the group. Click “Save” ; As five out of seven counts were serious, Hui sentenced Ng to six years and six months in jail. The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers. Read now
from us


Telegram JavaScript
FROM American