001const car = {
002 doors: 4,
003 colour: 'red',
004 maxspeed: 120
005}
006for(const property in car)
007{
008 console.log('propety name: ' + property);
009 console.log('Value : ' + car[property]);
010}
011console.log(car.colour);
012
013const car2 = car;
014
015car2.colour = 'blue';
016
017console.log(car2.colour);
018
019console.log(car.colour);
020
021/*
022
023if(car.hasOwnProperty('lights'))
024{
025 console.log(car.lights);
026}
027else{
028 console.log('the car doesn\'t have lights');
029}
030*/