From 8a84d58b5972bc826931df7fffabc850dd65af9c Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 19:20:06 +0530 Subject: [PATCH] Exercise 3.4 --- Chapter 3/Exercise 3.4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Chapter 3/Exercise 3.4 diff --git a/Chapter 3/Exercise 3.4 b/Chapter 3/Exercise 3.4 new file mode 100644 index 0000000..fec4127 --- /dev/null +++ b/Chapter 3/Exercise 3.4 @@ -0,0 +1,15 @@ +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);