Files
JavaScript-from-Beginner-to…/Chapter 3/Exercise 3.4
T
2021-11-24 19:20:06 +05:30

16 lines
298 B
Plaintext

const myCar = {
make: "Toyota",
model: "Camry",
tires: 4,
doors: 4,
color: "blue",
forSale: false
};
let propColor = "color";
myCar[propColor] = "red";
propColor = "forSale";
myCar[propColor] = true;
console.log(myCar.make + " " + myCar.model);
console.log(myCar.forSale);