I created codewars and portal.thecodingground.com accounts.

Freecodecamp

Wherefore art thou

ReadMe

Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching property and value pairs (second argument). Each property and value pair of the source object has to be present in the object from the collection if it is to be included in the returned array.

My solution

I have variable named srcKeys and the object.keys(source) and the object.keys(source) goes inside the collection array which accesses each an every object inside collection.

I used .filter so that a new array could be created and it should be returned.

I have a for-loop which will iterate and check for matching keys and properties.

I had an if statement which will check not matching property and not matching keys and when it finds the matching key and property should return.