Hey guys I am new to JavaScript and was learning prototypes in JavaScript and I faced the error:
main.js:19 Uncaught TypeError: bmw.move is not a function
with the following code:
function Car() {
this.model = 'BMW';
this.speed = 1000;
Car.prototype.move = function () {
alert('Move the car');
}
}
function BMW() {
}
BMW.prototype = Object.create(Car.prototype);
let bmw = new BMW();
bmw.move();