From fe763b45d968f5906e7a3b74ba0100265c306450 Mon Sep 17 00:00:00 2001 From: LSvekis Date: Thu, 27 May 2021 16:33:55 -0400 Subject: [PATCH] Update Chapter 3 Exercises --- Chapter 3 Exercises | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Chapter 3 Exercises b/Chapter 3 Exercises index 22d9800..8194811 100644 --- a/Chapter 3 Exercises +++ b/Chapter 3 Exercises @@ -20,12 +20,13 @@ console.log(finalList.lastIndexOf('Pop')); console.log(finalList); Exercise 3 -const myArr = [1,2,3]; -const bigArr = [myArr,myArr,myArr]; +const myArr = [1, 2, 3]; +const bigArr = [myArr, myArr, myArr]; +console.log(bigArr[0][1]); console.log(bigArr[1][1]); +console.log(bigArr[2][1]); console.log(bigArr); - Exercise 4 const myCar = { make: 'Toyota', @@ -35,10 +36,12 @@ const myCar = { color: 'blue', forSale: false }; -const propColor = 'color'; - +let propColor = 'color'; myCar[propColor] = 'red'; +propColor = 'forSale'; +myCar[propColor] = true; console.log(myCar.make + ' ' + myCar.model); +console.log(myCar.forSale); Exercise 5 const people = {friends:[]};