Just beginning my coding journey here. Attempting to create a car object and its instances. Here's the code snippet:
function Car(name, speed) {
this.name = name;
this.speed = speed;
this.describe=describeCar;
};
function describeCar(){
document.write("The Full name is " + this.name + " and the top speed is " + this.speed);
};
var mercedes = new Car("Mercedes benz", 233); // Instance of Object
var bmw = new Car("British motor Works", 260); // Instance of Object
mercedes.describeCar();
However, upon running the code, nothing appears in the browser. I'd really appreciate any guidance on what I might be missing or doing incorrectly. Thanks a bunch!.