Update Chapter 3 Exercises

This commit is contained in:
LSvekis 2021-05-27 16:33:55 -04:00 committed by GitHub
parent a11b71ee54
commit fe763b45d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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:[]};