At the moment the provided code will pass the test: collection.map(function(obj){ if(JSON.stringify(obj).includes(JSON.stringify(source).replace(/[{}]/g, ''))) arr.push(obj) })