From 75b9f881263296cb5e4dcc7f0614b17cb1a00818 Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:07:21 -0400 Subject: [PATCH 1/8] hasSiblings --- examples/object_array/complete.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/object_array/complete.html b/examples/object_array/complete.html index 13628eb..7207acd 100644 --- a/examples/object_array/complete.html +++ b/examples/object_array/complete.html @@ -25,10 +25,11 @@ // Create an array of all people who have siblings // You will need people.filter -const hasSiblings = - - - +const hasSiblings = people.filter(person => + if(siblings === true){ + hasSiblings.push +) +console.log(hasSiblings) // Create an array of all people who do NOT have pets // You will need people.filter From 53639a63cf48a3be5a7381add446b247561a5f72 Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:16:19 -0400 Subject: [PATCH 2/8] commas! --- examples/object_array/data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/object_array/data.js b/examples/object_array/data.js index 8940c42..0a50b6c 100644 --- a/examples/object_array/data.js +++ b/examples/object_array/data.js @@ -7,7 +7,7 @@ const people = [ siblings: true, pets: true, favoriteColor: "purple" -} +}, { firstName: "Julia", @@ -18,7 +18,7 @@ const people = [ pets: true, favoriteColor: "purple", closeSecondFavoriteColor: "green" -} +}, { firstName: "Thomas", From c44c7ac0efcad77a9e1f216cdcbdc2422f086708 Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:17:58 -0400 Subject: [PATCH 3/8] bracket issue --- examples/object_array/complete.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/object_array/complete.html b/examples/object_array/complete.html index 7207acd..7579417 100644 --- a/examples/object_array/complete.html +++ b/examples/object_array/complete.html @@ -27,7 +27,7 @@ // You will need people.filter const hasSiblings = people.filter(person => if(siblings === true){ - hasSiblings.push + hasSiblings.push} ) console.log(hasSiblings) From 89fa27f01436eca45b8068dd22d2d1decc47bb04 Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:22:16 -0400 Subject: [PATCH 4/8] finished hasSiblings --- examples/object_array/complete.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/object_array/complete.html b/examples/object_array/complete.html index 7579417..33a3f85 100644 --- a/examples/object_array/complete.html +++ b/examples/object_array/complete.html @@ -26,9 +26,7 @@ // Create an array of all people who have siblings // You will need people.filter const hasSiblings = people.filter(person => - if(siblings === true){ - hasSiblings.push} -) + person.siblings === true) console.log(hasSiblings) // Create an array of all people who do NOT have pets From 903ef0ffedd03e7a8a9ffd39758e88257ba25bf0 Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:24:14 -0400 Subject: [PATCH 5/8] added fake person --- examples/object_array/data.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/object_array/data.js b/examples/object_array/data.js index 0a50b6c..27ef452 100644 --- a/examples/object_array/data.js +++ b/examples/object_array/data.js @@ -28,5 +28,10 @@ const people = [ siblings: true, pets: true, favoriteColor: "light-blue", -} +}, + +{ + siblings: false, + pets: true +} ] From 26be8c6c1def70ada6f797eda30e891a934dcb5e Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:36:51 -0400 Subject: [PATCH 6/8] working on map --- examples/object_array/complete.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/object_array/complete.html b/examples/object_array/complete.html index 33a3f85..c2b7b87 100644 --- a/examples/object_array/complete.html +++ b/examples/object_array/complete.html @@ -31,21 +31,21 @@ // Create an array of all people who do NOT have pets // You will need people.filter -const noPets = - - +const noPets = people.filter(person => + person.pets === false) +console.log(noPets) // Create an array of all people who have pets but no siblings // You will need people.filter -const petsNoSiblings = - +const petsNoSiblings = people.filter(person => + person.pets === true && person.siblings === false) +console.log(petsNoSiblings) - -// Create an array that stores everyone's names in firstName,lastName format, sorted alphabetically by last name +// Create an array that stores everyone's names in lastName,firstName format, sorted alphabetically by last name // you will need people.map -const lastFirstSorted = - - +const lastFirstSorted = people.map(person => + `$(person.lastName), $(person.firstName)`) +console.log(lastFirstSorted) // Create a function that accepts two parameters - a color name and an array. // It then returns an array of all the objects where the person's favorite color matches. From 578b2dd506cda6fd322722d0a27dbfa4eb4452c4 Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:42:55 -0400 Subject: [PATCH 7/8] uppercase purple --- examples/object_array/data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/object_array/data.js b/examples/object_array/data.js index 27ef452..11da2a4 100644 --- a/examples/object_array/data.js +++ b/examples/object_array/data.js @@ -6,7 +6,7 @@ const people = [ age: 40, siblings: true, pets: true, - favoriteColor: "purple" + favoriteColor: "Purple" }, { From 095673a9ec0be4cb1a9cf7364f76f91f160a1a56 Mon Sep 17 00:00:00 2001 From: bolash-ju Date: Wed, 22 Oct 2025 09:55:07 -0400 Subject: [PATCH 8/8] end of Wednesday --- examples/object_array/complete.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/object_array/complete.html b/examples/object_array/complete.html index c2b7b87..c94f461 100644 --- a/examples/object_array/complete.html +++ b/examples/object_array/complete.html @@ -44,7 +44,7 @@ // Create an array that stores everyone's names in lastName,firstName format, sorted alphabetically by last name // you will need people.map const lastFirstSorted = people.map(person => - `$(person.lastName), $(person.firstName)`) + `${person.lastName}, ${person.firstName}`).sort(); console.log(lastFirstSorted) // Create a function that accepts two parameters - a color name and an array. @@ -53,14 +53,15 @@ // You will need a function, and I have started that code for you here. Your constants will use the function. function colorMatch(color,arr) { - const matches = - + const matches = people.filter(person => + person.favoriteColor.toLowercase() === color.toLowercase()) + return(matches) } -const blueTest = - +const purpleTest = colorMatch("purple",people) +console.log(purpleTest) -const blackTest = +const lightBlueTest =