Skip to content

Commit

Permalink
week06
Browse files Browse the repository at this point in the history
  • Loading branch information
hol23003 committed Feb 26, 2024
1 parent a4ad806 commit 86d8e57
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions week-06/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ function createPerson(name) {
}

const person1 = {
name: ["Hongchan", "Lee"],
name: {
first: "Hongchan",
last: "Lee",
},
age: 30,
eyes: "black",
height: "1.85m",
bio() {
console.log(`${this.name[0]} ${this.name[1]} is ${this.age} years old.`);
console.log(`${person1.name.first} ${person1.name.last} is ${person1.age} years old.`);
},
introduceSelf() {
console.log(`Hi! I'm ${this.name[0]}.`);
console.log(`Hi! I'm ${person1.name.first}.`);
}
};

Expand All @@ -25,15 +28,18 @@ function createPerson(name) {
};

const person2 = {
name: ["James", "Hush"],
name: {
first: "James",
last: "Hush",
},
age: 28,
eyes: "blue",
height: "1.79m",
bio() {
console.log(`${this.name[0]} ${this.name[1]} is ${this.age} years old.`);
console.log(`${person2.name.first} ${person2.name.last} is ${person2.age} years old.`);
},
introduceSelf() {
console.log(`Hi! I'm ${this.name[0]}.`);
console.log(`Hi! I'm ${person2.name.first}.`);
}
};

Expand Down

0 comments on commit 86d8e57

Please sign in to comment.