function Vehicle(type) {
this.type = type;
this.wheels = 4;
}
Vehicle.prototype.describe = function() {
return `${this.type} with ${this.wheels} wheels`;
};
const car = new Vehicle('Car');
const bike = Vehicle('Bike');
console.log(car.describe());
console.log(typeof bike);
console.log(globalThis.type); Post #2860
3.96K
CHALLENGE
- 👍 1