[Solved]Can only pass 3 of 4 tests in 'Wherefore art thou'. What am I missing?

Tell us what’s happening:
I can only pass 3 of 4 tests

Your code so far

function whatIsInAName(collection, source) {
  var sourceKeys = Object.keys(source);
  var result = [];
  var noOfMatchingProperties = 0;
  collection.forEach(function(element, index){
    noOfMatchingProperties = 0;
    for(var i = 0; i < sourceKeys.length; i++){
	if(noOfMatchingProperties === sourceKeys.length){
  return result;

Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:


I assume your code is failing on test one, right? This is because you’re checking if the property exists in both the collection and the source, but you also want to know its content.

Have a second look at that and probably it won’t fail.

Happy coding!

1 Like