Update Chapter 3 Exercises
This commit is contained in:
parent
a11b71ee54
commit
fe763b45d9
@ -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:[]};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user