Javascript - Object

1
2
3
4
5
6
7
8
9
10
11
var car = new Object();
car.color = "red";
car.brand = "ferrari";
car.topspeed = 150;
 
function getCarColor()
{
alert("My " + car.brand + " is " + car.color);
}
 
<button onclick="sayHello()">Click to say hello</button>