OOP / Anonymous Functions [Teach Yourself JavaScript]

javascript
non-track-course

#1

var Car = new Object();

Car.color = "red";


Car.brake = function() {
    alert("Braking!");
}

Car.brake();

#2

I keep getting an error
I cant seem to find my typo.

Anyone been stuck on this spot?

https://www.codecademy.com/en/courses/javascript-beginner-en-vj8Tr/0/2?curriculum_id=50802b7d5225bf0200000767


#3

You need to use console.log(); not alert();
Like this: console.log("Braking!");


#4

Thank you.
This fixed my problem.
This has helped me move forward through the tutorial.

I thought I had tried using console.log, but I must have done it incorrectly.
Thank You