Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Week3 patrick #71

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
completed C-more-complex-objects
  • Loading branch information
wonder woman committed Jul 13, 2020
commit a006b72b64b44a39236662eb09293c32cb1a6898
7 changes: 7 additions & 0 deletions Week-1/InClass/C-more-complex-objects/exercise-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ let house = {

WRITE YOUR CODE BELOW
*/
house.address = '51 Berkley Road',
house.previousOwners = ['Brian M.', 'Fiona S.'],
house.currentOwner.lastName = 'Montgomery';

console.log(house.address);
console.log(house.previousOwners);
console.log(house.currentOwner.lastName);

// - change the address of "house" to '51 Berkley Road'
// - change the previous owners of "house" to ["Brian M.", "Fiona S."]
Expand Down
8 changes: 8 additions & 0 deletions Week-1/InClass/C-more-complex-objects/exercise-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ let newCurrentOwner = {
WRITE YOUR CODE BELOW
*/

house.currentOwner = newCurrentOwner;
house.previousOwners[1] = 'Stephen B.';
house.isForSale = false;

console.log(house.currentOwner);
console.log(house.previousOwners);
console.log(house.isForSale);

// - assign the value of the variable 'newCurrentOwner' as the value to the house's "currentOwner"
// - from the list of previous owners, replace only "John A." with "Stephen B."
// - give the house a new property called 'isForSale' with the value 'false'
Expand Down
2 changes: 1 addition & 1 deletion Week-1/InClass/C-more-complex-objects/exercise-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let parkAvenueHouse = {

// returns the full name (first name + last name) of the owner of the house
function getOwnerFullName(house) {

return `${house.currentOwner.firstName} ${house.currentOwner.lastName}`;
}

// returns an array of the owners' email addresses of the two houses
Expand Down