Implement a Matching Object Filter - Implement a Matching Object Filter

Hello, watching your code I realized that the logic your implement goes the right way. But, I think you shouldn’t use .join(‘‘) method, instead, do you need to extract in srcKey and srcValues the keys and values respectively. After that,

  1. For each obj of arrOfObjs check if it has all the keys,

1.1) If true: check if all the key-value pairs match.

1.2) If false: continue for the next obj.

  1. If all the key-value pairs match in the step 1.1, then push that obj to the result array.

That’s the logic that I implemented, and it worked.

1 Like