Implement a Matching Object Filter - Implement a Matching Object Filter

should i JSON.stringify it ?

Have you looked into using a for…in loop?

for…in - JavaScript | MDN

Let’s stop back for a second. What’s your big picture plan for this function? What logical steps need to happen?

I would worry about syntax after you have a series of steps to execute to solve the problem, as the syntax is there to carry out your plan.

1 Like

i tried everything for in and not for in

i get the keys and the values but i donno how to solve it still

Like I said, let’s start with your plan instead of the syntax.

What is your plan for the logic the function should use?

i donno, i’ve no plans.
i just walk in random

You cannot solve coding problems in JS effectively without a plan.

1 Like

i think i should get string and compare it’s value with includes method with the array of keys or values to get truthy condition ,
then i back with the full array containing these values

That’s a start but let’s break that down into smaller steps with more details and no mention of code syntax.

If I was a kid doing this on pencil and paper, what would I need to do?

you mean i write it in steps
but i’ve problems with organizing my life
i try but i find it hard to me

i try brain storming but i think it’s on the air
nothing on the real ground

Yes, you need a clear plan before you start deciding what syntax to use.

1 Like

thanks for trying simplify it to me ,
i was feeling stress, now i get some comfortable
thank you so much for supporting me
i think there’s an idea in my mind
now i willl work on it

someone advised me not to use join method,
so i’ve no idea how to compare values between two arrays without converting it into string
then i use include method ?!!
any hint here ?

I would not focus on the syntax. I would focus first on developing a clear, step by step plan of what you want to do.

i think i am downing into a deep sea

this is a planning steps he gave me but i donno how to execute it into code

how

i donno how can i check for each obj if it has all the keys ?!!
the keys of the source object is first, last

You need your own plan though.

Can you please try to answer this question?

i logged everything
all i see is arrays
key arrays which is first last
and values arrays which is Tybalt Capulet